Why Vim Sucks

I’ve used Vim (MacVim to be exact) now for a number of months and after working with it have come to the conclusion that it simply is not a viable text-editing solution. There are a number of things wrong, but my short list is a mere three items.

Reading code is unwieldy (scrolling).

Continued annoyance here is what has led me to pass on MacVim as a tool. Any non-trivial application will have more code in it than a person can grok without reviewing sections so I need an easy way to do this, my most common task. First I’ll run a find to get me in the vicinity of say, a function I need to review, and then I start reading. At this point Vim purists may start yelling at me, but I feel like the best tool for this is a mouse. While reading I am already not actively typing, and with my trackpad that allows me both horizontal and vertical scrolling I can simply gesture to move about and read. Once I find where I need to be, I click, and switch modes again to typing.

The problem here is that no GUI Vim (that I am aware of) supports horizontal scrolling of any measure. This wasn’t an issue in the days of X character lines, but these days it is the bale of hay that broke the camel’s back.

It is completely unusable until you modify your settings.

Let’s come up with some sensible defaults, people! To make it usable I had to browse around a whole bunch of websites to figure out what settings I needed to set in order to have it do basic things a text editor should be able to do, like hanging indents. I’m completely comfortable with that, but how about a nice well-explained example.vimrc to make my life easier? I ended up borrowing a .vimrc and modifying it as I saw fit but simply not knowing what all is possible *forces* you to read the entire (huge) manual of options. No thanks, even a number of months later and I wouldn’t count myself among those that are happy with my settings.

Which line or character am I focused on?

Every time I exit insert mode I move back a character. Really? Who ever thought that was a good idea? I press enter in normal mode and it inserts a new line below my current line. That breaks a UI pattern of every other text editor I’ve ever used. Sure, I’m sacrificing discoverability in Vim for some of its more powerful tools, but just because I don’t care about discoverability doesn’t mean you can screw with something I’ve been taught in every other application but yours. Let’s just say that I want a consistent user interface pattern because when I exit other modes it doesn’t move me back a character. And when I’m in insert mode, enter does put a line break where you’d expect. Continuity, please.

More generally, how about a cursory review of people new to Vim and seeing what does and doesn’t turn them off about using it, and then implement changes that make these new users more comfortable. For all I care do it in an example.vimrc file, but for (your geek pseudo-deity)’s sake, give people new to Vim a fighting chance! A good bet is that not all users are as masochistic as I am, and I gave this a really long, very intentional trial period before ditching it. Fix these issues and I’ll come back and revisit my evaluation.

(Yes, I’m being a bit inflammatory and not everything I am saying is a cohesive argument against Vim, but I’m venting—allow me that before you criticize me too harshly in the comments.)

8 thoughts on “Why Vim Sucks”

  1. Thank you! I used gVim for several weeks at work and at home doing PHP, and honestly, it and emacs can go swim in a dirty lake full of rusty nails. I like being able to get around in both, because I’ve needed to do configuration on servers that don’t have nano installed. But for day-to-day development? gEdit (spiffified to be like textmate) in Ubuntu for rails/php, and notepad++ (also dolled up) in Windows for php.

  2. You really should have talked to me first before this. MacVim supports horizontal scrolling. The enter key’s functionality is not insert new line below by default, and in terms of the moving one character back thing, it’s not an issue if you use the correct keys to go into insert mode. Moreover, it’s just a matter of getting used to it/you making it used to you. I can certainly read code just as well, if not better than a mouse… but that’s because I set it up to know how I want it to behave.

    The point of vim isn’t to be easy from the start, and while it sounds like a cop-out (and it is) I don’t care. It certainly has some weird flaws and I would argue discoverability is certainly one of those. But, as a tool for productivity it’s hard to beat once you get over that tremendous learning curve. Could it be better? Ab-so-lutely, but until we have the time to make something of a better design, it’s hard to get there in the current editor market.

    In any case, what are you going to then? Textmate I hope?

  3. Oh.. and I want to point out that there is no doubt in my mind we could come up with a better designed modal editor. However, the sheer amount of work it would require is daunting. I think Vim is caught up in old-zealotry syndrome – it’s locked in to a certain methodology because it’s been around so long and that’s what people expect. That’s the only reason I say we can do something better; new eyes.

  4. Chris, I enabled horizontal scrolling, but I can’t use my trackpad for it. <MouseUp> and <MouseDown> are the scrollwheel events for vertical scrolling but the X axis was conveniently left out. Additionally, when I’m horizontally scrolling (have to snag the scrollbar), I can only scroll as far as the wrap of the currently focused line. Those two are showstoppers. It also does this really annoying thing where it counts the current 80 characters as existing. If I’m four characters into typing a line, I can already scroll on that line by four columns. Change rows and the scrollbar adjusts again… the constantly adjusting scroll bar is distracting.

    I played a lot with .vimrc, namely the one you gave me. Upon its complete removal I was still able to use enter to insert a line in normal mode. That would imply to me that the functionality exists in core. I’ll check again tomorrow to make sure I’m not lying.

    As to *entering* insert mode–that was never a problem, but every time I exit some mode my cursor position gets played with in unintuitive ways. What is so hard about not moving it?

    I feel like I gave vim its due diligence: I spent my hours reading the docs. I am past the learning curve, I know how to do every bit of the major functionality, but when it is easy for me to make mistakes when I don’t make those same mistakes in other editors I’m going to place that blame on the tool: make it easier to succeed. (Did you ever read The Design Of Everyday Things?)

    And yes, we could do a better modal editor. Heck, build one on top of VS10… *grin*

  5. Wow. Talk about really minor reasons for ditching vim. Even if there was nothing to be done to mollify you on these points, by ditching vim you’re giving up on a ton of amazing features.

    Yes, this post is titled "Why Vim Sucks". But to focus only on why it (in one person’s view) sucks and ignore why it rocks is really quite unfair. Fortunately, there is no shortage of other websites that go in to great detail on why many other people love vim.

    I’ve been a vi/vim user for over 20 years, and I’m finding new reasons to love it every day, and very few reasons to dislike it.

    It does take some learning, though. And that may be its greatest weakness. I think the underlying reason that most vim users don’t like it is that they don’t know it particularly well, and don’t realize what it’s capable of.

    Vim could save you countless hours of drudgery and make all sorts of routine editing tasks relatively painless, where the overwhelming majority of editors would flounder.

    Which leads me to wonder, what editor did you switch to, Nathan, that’s so much better than vim?

  6. aaa:
    I’m well aware that vim is quite functional for a number of things (I still use it when I’m working on things remotely), but failing at my number one use case, reading code, is unacceptable. This is not some trivial task and nor is it a minor issue–this needs to be an extension of how I think.

    As to the customization to make the features I want available, I really did spend some effort. I got it quite close to how I wanted, but it still doesn’t work just right. However, that the complication for my relatively trivial use is that high, arguing that it is completely configurable is a cop-out. So is any open source editor, by that logic. (Not saying that you’re arguing that, just reiterating a position.)

    I’m game for trying again if you have a solution to the scrolling problem and can send me a copy of your .vimrc to borrow what you’ve come up with over the past 20 years. I try very hard to be fair in my evaluations of things and if I’ve missed something, I’d love it passed my way. I do primarily JS, HTML, CSS, and PHP development with other higher-level languages thrown in for good measure.

    And hey, I was complaining at the time and wasn’t trying to be fair to Vim… *grin* (though I didn’t find any feature in Vim that I was using that couldn’t be emulated in other editors, excluding the buffers). I am presently using Textmate–also rather configurable, but more pleasant to use–I can now read code the way I want to.

  7. Well, from a perspective of an unabashed vim lover, the need to use a mouse to scroll around a text file is a bad habit to be broken, not encouraged. I just feel I’m much more efficient when my hands aren’t moving back and forth between my keyboard and mouse.

    Now, whether you feel the same way about this issue is really a matter of personal preference, which is why your post should be titled "a few reasons I don’t like vim", rather than "why vim sucks" (though the latter is more flamewar worthy, I’ll admit).

    As for vim’s ability to scroll with the mouse, it is possible to do so vertically (see http://www.vim.org/htmldoc/scroll.html#scroll-mouse-wheel ), but not horizontally… though it is quite possible to scroll horizontally with the keyboard (see http://vimdoc.sourceforge.net/htmldoc/scroll.html#scroll-horizontal ).

    You are right about us no longer being in the days where everyone used 80-column terminals. My own 1600×1200 screen displays 158 columns quite comfortably. But I do generally try to stick to the 80-column standard myself, so that what I write is easily readable by people who aren’t as fortunate to have a nice, wide display.

    Still, thous 158 columns are there for when I need them, and when I do need them, I don’t like to have to scroll horizontally at all. I prefer my eyes to be doing the scrolling, not my hands. I find it really annoying when parts of the text I’m reading is invisible off of one side of the screen (another matter of personal prefernce).

    Another one of your complaints was about the cursor moving to the left after getting out of insert mode. That can be fixed by putting the following in your .vimrc:

    inoremap <S-CR> <Esc>l

    Then (in gvim) you can hold down SHIFT and hit ENTER to get out of insert mode, and your cursor will stay in the column where you stopped typing. In terminal vim you’ll have to choose some other key/key-combination to remap. But DO NOT remap your ESCAPE key, as it can and probably will break scripts.

    As for my .vimrc, I am happy to share:

    My .vimrc – http://pastie.org/497574
    My .vimrc-colors – http://pastie.org/497568
    My .gvimrc – http://pastie.org/497570

    I should note that I’ve only recently been heavily in to vim, and I’m still learning quite a lot, despite having used vi/vim for a long time. So other people’s .vimrc’s probably have a lot more useful stuff that mine lacks. Also, some portions of my .vimrc have been cobbled together from other people’s .vimrcs and various other sources on the internet… so don’t blame me for everything ;)

    Finally, I would like to invite you to #vim on the freenode.net irc network if you have any questions. There are a lot of very knowledgeable people there, including many script developers (and former Textmate users). And also check out vim.org for thousands of vim scripts and tips.

  8. Vim rocks. Please take the time to learn it properly and you won’t go back.

Comments are closed.