One thing I use snippets for is as a simple, convenient memory aid; for example, I currently have (most) of the Ruby standard exception types as snippets with the tab trigger "exception". So I type in "exception", tab, and get to choose which of the exceptions I really want to use.
However, defining and maintaining (in case changes are wanted) such a large number of small snippets is sorta annoying when going through the Bundle Editor. Is there a way to have multiple snippets in one file, including the various settings such as tab trigger, keyboard shortcut, etc.?
A better way to do this sort of thing is to write a command. Something like this:
#!/usr/bin/env ruby -wKU require "#{ENV['TM_SUPPORT_PATH']}/lib/ui" exceptions = [ 'Exception', 'AnotherException' ] index = TextMate::UI.menu(exceptions) STDOUT.write("${0:#{exceptions[index]}}")
Try creating a textmate command with these contents, set 'Input: None', 'Output: Insert as Snippet' and of course set Activation to 'Tab Trigger: exception'.
The command is attached as well.