Vim/emacs war : )
When it's between vim or Emacs it's mostly Emacs for me but a quite customized Emacs where I move the cursor and do selection in a vi-style (because Emacs's default CTRL-F / CTRL-B etc. simply hardly makes any sense whatsoever). I also remapped
ctrl-x-map to something else than CTRL-x because that one is seriously hard to do when you remap caps-lock to act as a ctrl (and anyway ctrl-x is not convenient).
Emacs is really powerful that said. Just an example: the other day I was maintaining some old and kinda crappy codebase where a lot of constants where hardcoded into some source code file and one new constant had to be introduced in the middle of two other (don't ask, not my call ; ) and we didn't have the time to rewrite everything. The code was looking like this:
SOME_SILLY_STUFF = 21;
SOME_OTHER_SILLY_STUFF = 25;
STATE_A1 = 23;
STATE_A2 = 24;
STATE_A3 = 26;
STATE_B1 = 29;
STATE_B1 = 27;
STATE_B1 = 28;
STATE_B1 = 30;
... (here comes lots of lines that I do not want to modify manually)
STATE_Z1 = 86;
And I had to insert a "STATE_A4 = 29" and hence increment all the subsequent hardcoded constants (once again, not my call).
Under Emacs, such kind of manipulation are trivial. In this case, it's a
query-replace-regexp followed by simply this:
\b[0-9][0-9]\b
\,(1+ \#&)
The first line is the regexp: whatever, it's one way to match what I need to match.
The second line is the Emacs / Lisp killer: the '\' indicates I want to use Lisp to calculate my replacement string: (1+
every_match)
That's right: in less than 30 keystrokes all in all I did use some Lisp to add 1 to all the 70 values or so that needed it. 30 keystrokes and Lisp. That's how powerful Emacs is.
I know a lot of people who, faced with the same problem, would have used much, much, more than 30 keystrokes to fix the problem.
There are Emacs videos on YouTube where people much more skilled with Emacs than I am show what they can do. It makes people's jaw drop : )
The following one is always a good read (a bit provocative and very cool):
http://www.paulgraham.com/lisp.html