Fast hash-pair macro
Protip: you can use :<tab>
to quickly write out a bunch of hash pairs in Ruby. Rails coding
especially tends to involve writing a fair amount of hash pairs. The
default snippet makes this a lot more pleasant (what big effect such a
small snippet can have).
However, for some odd reason, the last tab-stop in the default snippet is just a comma. I can’t imagine what purpose that has – it would be much nicer to first select the comma (so you can just delete it and move on to something else) and have another tab-stop after that that, right next to another double-colon so you can make a new pair instantly. So… here it is:
:${1:key} => ${2:"${3:value}"}${4:, :$5}
- read more
- 07 May 2007 22:28
- no comments
Comments
Copyright © Intractable Complexity
Powered by Typo