4

I'm improving our free IDE CodeFusion and just added configurable snippet support in the new version. Internally we are using ACE Editor. Now technically I'm already done and it works like a charm.

With ACE also came a bunch of pre-defined snippets - which are very nice for JavaScript but not perfect for APEX and all Salesforce-special-stuff.

The Snippet-Format is something like ApexMate - it also reminds me of Sublime-Snippets. Just as an example they look like this:

snippet for-\n\
    for(var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n\
        ${0:${2:Things}[${1:i}];}\n\
    }\n\
# for (...) {...}\n\
snippet for\n\
    for(var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n\
        ${3:$2[$1]}$0\n\
    }\n\
# for (...) {...} (Improved Native For-Loop)\n\

But I don't mind the format - it looks pretty easy to adjust or convert them if necessary.

What I'm more interested in is a snippet-collection which has proven to be good in any environment and has evolved through time and many projects. Sure thing I can write my own - but actually I just started the snippet-business and would have to start form scratch. Now I would be interested if any MavensMate/Sublime/TextMate enthusiast maybe have already something and are in the mood of sharing it with the community?

A short google reseach brought up nothing on the first page. I had also a quick look in Joe Ferraros MavensMate and @superfell ApexMate but either they come without snippets - or I didn't see them.

Anyway one brilliant snippet collection could improve all of our IDEs (at least those supporting them at all). Would you like to share?

  • Hello @Uwe Heim. Are you after Javascript snippets only, or Visualforce and Apex as well? I read question title as if everything has to be Javascript related. – gaiser Jul 27 '15 at 7:45
  • @AdrianLarson As I wrote in the text, for JS I have something (default stuff shipped with ACE Editor). So we have vanilla JS, but no Salesforce-specials. My focus NOW is clearly on APEX first, followed by VF-Markup snippets, followed by Lightning, followed by JS-for-Salesforce-freaks. In exactly that order :-) – Uwe Heim Jul 27 '15 at 7:52
  • if anyone likes to see it in action, just check it out: login.salesforce.com/packaging/… - feedback welcome – Uwe Heim Jul 27 '15 at 7:53
  • if Visualforce is on your list then check these snippets: github.com/neowit/vim-force.com/blob/master/snippets/…. This is for vim's UltiSnips, but format looks similar to one in your example, so should not be hard to convert (if necessary). – gaiser Jul 27 '15 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.