Minor TextMate Annoyance
A recent update to Textmate added a variable to the do snippet. So when you type ‘do’ followed by a tab, you get
do |variable|
end
Most of the time I don’t need a variable, so I want the default ‘do’ snippet to not have a variable.
Open TextMate and use the keyboard shortcut to open the Snippet editor (Ctrl+Alt+⌘) Click Ruby in the Snippets area, click the plus sign (+) in the bottom left corner and click ‘New Snippet’.
Name the snippet ‘Insert do … end’, assign Activation (Tab Trigger) the value ‘do’ and Scope Selector the value ‘source.ruby’. The snippet text should be
do
$0
end
Finally, change the existing Snippet named ‘Insert do |variable| … end’ Activation (Tab Trigger) the value ‘dov’. Now when you type ‘do[tab]’ you will get the ‘do … end’ block without a variable. When you type ‘dov[tab]’ you will get the ‘do |variable| … end’ block.
More of my rantings
These might also interest you
- 10 Excel Tips to Make Your Life Easier – Part 1 (Tomas Carrillo)
- How To Add a Vertical Line to an Excel XY Chart (Tomas Carrillo)
- Turn Your Computer Into A Buddha Machine (Tomas Carrillo)