Vim Is Wrong

I just saw this post on Stack Overflow about some clever vim commands and as a vim user  I was glad to learn some new tricks I can use.  Then I read the reddit comments about the story and found this (screencapped in case that link changes):

When writing software the code is written once but probably read dozens of times.  Therefore, readable code is very important.  This is one of the central tenets of Python.  These commenters are debating whether readability is equally as important with Vim commands as it is in programming languages.

Previously I would have sided with the advocates of Vim's terse command syntax without much thought.  Short commands are easier to type and can be more effective.  However, this thread made me reconsider.  Because of Vim's terse commands, they are harder to learn and to remember.  And once a command is learned, it may be learned as a magical incantation and not a sequence of instructions, so the components won't be learned and reused for other needs.  So unless a Vim user spends a considerable amount of time learning commands, they'll be using the editor inefficiently and getting less done than they could because of Vim's terse commands and steep learning curve.  I'm no longer sure that the efficiency gained by having short, easy to type commands is worth the efficiency lost by having a large set of hard to remember commands in your brain, and an equally large set that you aren't using because you don't know them.

Python has a relatively small syntax.  Most things are explicit so there aren't a bunch of implicit things you have to remember to know what your code is doing.  The advantage that gives a developer is that they can write code more quickly without having to look up syntax rules or function calls all the time.  Also, a new developer can come to the code and will understand the program more quickly with fewer things to learn.  As I thought about Vim's command complexity, it occurred to me that we already have a command set that's easy to write, read, and remember, and it's quick and easy to write a short script like the one in that Stack Overflow comment: Python!  Why can't Vim use Python to edit the working document?  The Python scripting support is a good start for complex add-ons, but why not make it even more integrated with things like :find('query') instead of /query?  I'm very curious if a readily accessible, full blown python interpreter would make my vim use more effective.

P.S.  Emacs?


Scott: This sounds a lot like advocating tacking on a scripting interface to the driver controls in a car because it's hard to learn to drive without practice and justifying it by saying that the scripting interface makes driving skills more readable.

tsaylor: The difference between driving and vim is that almost all the controls on a car are physical, so by looking you can see what's available. That's more like a GUI interface, and this sort of UX problem is why GUIs were invented. There are software car controls, and even non-obvious physical ones, but they're all less essential features. Anyone can get in a car with an automatic transmission and start driving it, but they may have to ask or look for the lights and wipers (which is a bit frustrating, but tolerable).

Cezar: If you had such a car, and you put that scripting interface on it. That bucket of awesome would be called the Emacs.

Brian Madigan: The good thing about vim is that MOST of what you do with it day-to-day is pure muscle memory. The bad thing about vim… there is no bad thing about vim. Generally you have to learn emacs or vim. I started with emacs, but to do basic commands required what I felt to be unnatural contortions of the hands. Vi is more ergonomic, at least for me. You don't need to know 100% of what's available in Vi, just enough to use it for your own purposes.