A script that partially mimics TextMate's snippets feature

A script that partially mimics TextMate's snippets feature

29
Basic UserBasic User
29

    Aug 11, 2009#1

    I've written a script that partially mimics the snippets feature from TextMate (it's also found in few other editors like NetBeans):

    https://www.ultraedit.com/resources/scripts/snippets.js

    It doesn't have all of TextMate's advanced snippets functionality, it just replaces the keyword under the cursor with a snippet (preserving the indentation), and optionally moves the cursor to somewhere in the snippet. I've sent a request to IDM to add a full snippets feature, and I suggest you do the same.

    The default snippets are ones I like to use for HTML/PHP/JavaScript, but you can easily change or replace those with whatever works for you. Also, the default snippets contain tabs which you may want to replace with spaces if that's what you use for indentation.

    Cheers,
    Sean

    3
    NewbieNewbie
    3

      Aug 12, 2009#2

      Thank you for the script.

      4

        Jan 21, 2010#3

        Sean:

        I had messed around with the Zen Coding and happened to see your post mentioning your script and I'm so glad I did. I really like it and find myself using it all the time now. Although Zen Coding has some powerful stuff for certain coding, I like your setup which seems easier to create well formatted multi-line replacements.

        The ^ for user choice of where to insert the cursor after text replacement is super.

        Awesome job!

        Doug
        Doug
        UE 16.1