I’ve seen that you can create snippets which as far as I understand are almost like code complete – in that you start typing something and it brings up your snippet.
http://wiki.appcelerator.org/display/tis/Creating+a+new+snippet
Firstly where is the “existing bundle.rb file”?
Secondly, if I wanted to add html tags around text, is there a way to do this? For example, highlight a few lines of text and add
or tags around it? Or even at the beginning and
at the end.
much appreciated.
Follow the instructions in the note in the linked wiki page to create a new ruble. That will create a project in your workspace. Inside that folder you will find a bundle.rb file (or alternately, there is also a snippets.rb file in that new project you can use as well with an example snippet already created)
As to inserting items around a selection, yes. In that case, I would use a command, since it’s a little easier to trigger. You’d make a selection, and then use a key shortcut or menu command to trigger it. An example below:
Note that this takes the current selection, wraps it in open/close tags, and re-inserts that as a snippet, suck that you can re-edit the open/close tags to your liking. If you didn’t need that, you could make a simpler version: