|
I look at it like this: When programming, you spend comparatively little time actually writing code. The vast majority of the time is spent reading existing code, and most of the remaining time is modifying the code you read. It actually pretty rare that you sit down and write an entire method or class in one go. Most editors, however, always have you in the writing state: Just about any key you press will be added to the file you're looking at. If you don't want to add characters to the file, but still need to do things, you need to add modifier keys like Ctrl or Meta or Ctrl-Shift-Meta to the actual key. To move around the file, or between files, or search for more code, requires these longer chords of keypresses. To edit small bits of code require more chords. As such, the things that you do most of the time (reading, modifying) when coding require the most complicated keystrokes. The default "mode" of an editor like vim is reading. Nearly all of the keys you can press in that mode are just to move the view around or switch files. Eg, the keys to move by a single character (`jkl;`) are all on the home row. To move to the next block of code is simply `]`. To jump to a specific character is `f` + that character. To find some string is `/`, and then `n` jump between matches. And then to copy/paste some code is just `y` and `p`. In any other editor, all of those actions would require one or more modifier keys. So in my mind, vim's primary advantage is that the sorts of things you're doing when coding take many fewer keystrokes, and hardly any modifiers that contort the hand. And then on top of that, all of the actions one can take in vim can really be thought of as functions that take arguments. So you can use the "copy" action with any movement action (char, line, paragraph, find, etc...), and that's the part that will be copied. Prefix an action with a number, and it'll be repeated that many times. It's this mindset that few other editors can manage (and even the vim emulators miss some of the really cool stuff), which is why they have have my vim when the pry it from my cold, dead, carpal-tunnel-laden hands. |