6,675585
Grand MasterGrand Master
6,675585

    May 14, 2009#16

    Since UE v14.00 you can use environments. With environments you don't have anymore only 1 template file. Every environment has it's own template file (*.te1). So it is possible for example to switch the environment for a HTML project to a C/C++ project and use C/C++ templates instead of the HTML templates.

    The auto-complete feature can be already configured to work based on the file extension. So it is possible to create strings for being fast inserted into the file using auto-complete. The auto-complete feature is just a little bit limited. You can specify a long string, but not a multi-line string. It is not possible to insert an auto-complete string around a current selection or specify the cursor position after inserting a string.

    However, with macros and scripts you can "code" your own fully customized "snippet" support. It's up to you how powerful and smart that macros or scripts work to help you working more efficient.
    Best regards from an UC/UE/UES for Windows user from Austria

    14
    Basic UserBasic User
    14

      May 27, 2009#17

      The proposed workarounds are not substitutes for actual textmate/e style snippets. They all involve mousing around to find the particular chunk of text desired from a pick list. Snippets use the context of both the file extension and the text in the vicinity of the cursor to figure out what's called for, so your workflow isn't interrupted.

      If I'm editing a ruby file and I type 'class' and then hit the tab key, the e text editor types out:

      Code: Select all

      class ClassName
      
      end
      
      The text 'ClassName' is highlighted, so that the next thing I type overwrites that w/the name I've chosen for the class. When I hit the tab key a second time, the cursor jumps down to the empty line before 'end', indented one level & ready for me to keep working. I never have to take my hands off the home row of the keyboard.

      That's just one example--there are a ton of snippets defined in user-contributed bundles that do useful things like that.

      To see a good demonstration of textmate snippets, see any of the railscasts, e.g., http://railscasts.com/episodes/73-complex-forms-part-1 .

      Cheers,

      -Roy

      6,675585
      Grand MasterGrand Master
      6,675585

        May 28, 2009#18

        So snippets in textmate are user-contributed macros/scripts/plugins for a particular language and not a core feature of textmate itself. Well, in UltraEdit you can write macros and scripts associated to hotkeys. I guess, especially a script can be programmed smart to get the same behavior as the snippet for Ruby in textmate.
        Best regards from an UC/UE/UES for Windows user from Austria

        14
        Basic UserBasic User
        14

          May 28, 2009#19

          LOL--the way I would say it is that supporting bundles (which include snippets, syntax highlighting rules, and other stuff) is a core feature of e/textmate (e started out as a windows clone of textmate--you can use a textmate bundle in e w/only minor changes (line-endings, remove verboten chars from filenames)).

          Many of the bundles are user-contributed, several were developed by the authors of textmate.

          I definitely take your point about being able to macro my way to the same behavior. Is it possible to combine libraries of macros together and have them selectively activated depending on file extension? Is there already (or can we create) a clearinghouse for UE macro libraries? Having that sort of thing would encourage sharing I think.

          2362
          MasterMaster
          2362

            May 28, 2009#20

            Widespread sharing of user macros and scripts would be a good thing to encourage.
            “Don’t document the problem, fix it.” – Atli Björgvin Oddsson

            6,675585
            Grand MasterGrand Master
            6,675585

              May 29, 2009#21

              You can store multiple macros in one macro file. All my macro files contain multiple macros. You can specify 1 macro file to be automatically loaded. You can run a macro in an automatically loaded macro file by macro hotkey, by menu command Macro - Play Any/Multiple Times or by double clicking on a macro in the macro list view (View - Views/Lists - Macro List).

              Better are scripts because you can add a nearly unlimited number of scripts to a script list which enables you to run every script by a script hotkey, from the menu Scripting or by double clicking on a script in the script list view (View - Views/Lists - Script List).

              It is not possible to activate macro files or scripts depending on the file extension. But you can develop your macros or scripts to take the file extension into account and act accordingly. With this method you can assign a hotkey to a macro or script which does different things according to the file extension. You can see here a very simple macro used by me daily showing this technique.

              Some users already submitted macros and scripts - see Downloads - Extras - Macros & Scripts.

              Update: Support for snippets added to UltraEdit in v18.00 and UEStudio v12.00 named Smart Templates.

              Read more posts (-9 remaining)