I’ve often wondered how in Ruby screencasts they magically execute code inline in the editor, e.g. they type:
…and it magically becomes
You can see how effective this is in action in one of the sample episodes for Ruby Tapas by the wise and excellent Avdi Grimm.
Today I learned how. Apparently it’s a Textmate feature called “Execute and Update ‘# =>’ Markers” which has been ported over to other editors:
- Plugin for Sublime Text2
- Plugin for Vim
- Instructions for Emacs (using the rcodetools gem)
This also explains why the Sublime Text snippet for #
expands to # =>
. I’d always
assumed that this was intended to make multiline comments more readable. That
sounds a bit silly now that I know :)