Thank god, someone else who has seen the light.
Ah, that's it: now god comes in. It's official: the editors war becomes... Religious!
You can pry my Emacs from my cold dead hands, you pagans!
Btw I know that Emacs can do arbitrary computation (any computation, as in "using elisp") directly in substitution strings and that vim certainly can do computation in substitution strings. What about other editors? Is this something they can do too? (this is not a stab: I'm genuinely curious)
This thread lacks animated .gifs about our preferred text editors...
Complains (say about color scheme or font -- btw, it's a pixel-perfect font and the .gif is correct but for whatever resizing reason when inlined in GH the .gif is stretched and becomes all blurry... whatever) and hate can be safely sent to /dev/null :
I did use
vr/replace instead of
replace-regexp to show the grouping / replacement.
Basically in the replacement string:
\,(+ \#2 (* 60 \#1))
\#2 and \#1 are references to the regexp group (which, in this case, transform minutes:seconds into seconds) and
\,(...)
is the real magic: you can put any elisp code you want in here. Here it's just simple arithmetic but you can really do anything you want.
This is from a recent question on SO about how to use vim to do such a thing. Someone posted a 22 keystrokes (!) version using Emacs.
The video is recorded using
ffmpeg from a shell running... Inside Emacs! (I made the window tiny to be nice with GH's bandwith).
As far I know the text editor in big IDEs are very, very limited which is why I welcome project like eclim and emacs-eclim which allow to use vim or Emacs as your text editor and Eclipse as the server... If only the same existed for IntelliJ IDEA (I know there's at least one such project going on). Maybe that in ten years we'll have something like Grok (from Google / Steve Yegge) catching on and we'll be able to use the editor we want within any IDE (Grok is about much more than that but it should have the benefit of being usable as a back-end for the editor we want as I understand it).