1. 10
  1.  

  2. 11

    At first, you do everything as simply as possible. Then you start to wonder if there are faster ways to get things done, and there are! If you chain those commands together they just work! You bump into things accidentally, or maybe you spend some time in the extensive help files. Over time, you burn a few advanced tricks into your muscle memory.

    This is the exact definition of a learning curve to me. The famous vim learning doesn’t necessarily has to be hard. You just get more and more efficient with it over time, because it is a new concept. That is not a bad point per se! I feel like this post is arguing against a non-problem, am I missing something?

    1. 14

      A lot of people don’t know what they mean when they say “learning curve”. Everything has a learning curve. Vim’s is certainly long (years later you’ll still be learning) but not as steep as it’s made out to be.

      1. 2

        A thousand upvotes for this!

        The thing is, a text editor more advanced than Notepad will have things you can learn. It’s a kind of laziness or dispassion that keep users of Emacs, Sublime, Vim, or whatever, on that Notepad level.

        The long yet shallow learning curve is something to be embraced, it’s the sign of a powertool.

    2. 4

      One point of anecdotal data: I tried vim for a while and two weeks in I was still getting hung up on switching between modes to do things.

      1. 2

        This is my issue with vim but remapping escape to caps lock helped.

        1. 1

          Did your Vim tell you which mode you’re in?

          I don’t know what kinds of defaults are common nowadays, but I’ve learned to rely on visual cues. It’s not impossible to always hit escape first, just in case, but it ain’t exactly nice either.

        2. 4

          I’m a big Vim enthusiast and have been sticking Vim in every code editor I’ve used for years - Visual Studio, IDEA, plus actual Vim - and I think this article is bunk.

          It isn’t like Street Fighter because nobody is trying to work and build complex things in Street Fighter. When you’re first getting used to how to do thing in Vim, at least the first few weeks of use, you’re going to have to stop and think carefully about every keystroke and movement you make to get where you want. You’ll have to keep a quick-reference chart somewhere and look to it often, and try to read the help files and Google searches often. This is all doable, the really tough part is thinking about your code and the architecture of it while also constantly getting hung up on how to use your text editor. By the time you get to where you want to insert something, you may have forgotten exactly what you were going to write and why.

          To be productive in Vim is to get over that hump, to get to the point where you think to move somewhere and you just do it without thinking about how. You have to get there in order to be spending most of your brainpower on what you’re actually trying to do. You will not get there in 30 minutes, and even 2 weeks is highly unlikely.

          Nevertheless, I do agree that putting in the time is worth it in the long term, to be able to fly through your codebase without thinking or even touching a mouse.

          1. 4

            I strongly disagree and think that vim is really, really hard to get good at. It also has nothing to do with anything special about Vim-style editors (modes, composeable commands, etc) and is almost entirely about problems in Vim itself. Let’s go into some of the problems.

            No Discoverability

            You often hear Vimmers go “I’ve been using this for years and never knew that! This is awesome!” Sure, it means that Vim is deep. It also means that Vim did a bad job in teaching you. Here’s one example: one of my favorite tools are text objects. If you follow an operator with a text object instead of a motion, it operates on the higher text structure. di) deletes everything inside parenthesis, yaW copies a WORD, etc. Text objects are incredibly powerful and make editing complex functions a breeze. How do you discover it?

            • Vimtutor doesn’t mention it.
            • :h i just mentions insert mode.
            • Searching operators just tells you about {motion}, and {motion} doesn’t mention text objects.
            • If you read the docs on visual mode, it says that aw is a thing but doesn’t tell you that it’s extensible or usable with operators.

            You have to look up :h text-objects or :h v_a, where it mentions offhand that you can use it with operators. Most people only find out when someone else tells them.

            If you want to look up modifier keys, you have to do :h ctrl-{}. If you want to look up what something does in insert mode (if you even realize you can do commands in insert mode), it’s :h i_{}. This only for direct lookups: the docs are poorly written and realizing what’s going on takes forever. And if you want to find anything out besides just keystrokes, you’re pretty much SOL. Figuring out how the ruler worked was probably the worse experience of my life, and I got a root canal without anesthetic.

            People complain that newbies use plugins like NERDTree and ctrlp instead of netrw and fileglobs. But finding out that netrw exists (much less how to use it!) is its own project.

            Speaking of Plugins…

            You need plugins to use Vim well. At the very least, you need language plugins to make sure your indent works properly. Up until Vim8, you had to find a plugin manager yourself, figure out how to set it up and use it, and then google around for what looks like a usable plugin and hope you got the right one. It’s easier, of course, if you have someone helping you through it, but that’s the exact opposite of a gentle learning curve! Critical information about your editor (how to extend it) shouldn’t require finding a mentor to pass on the oral tradition.

            Configuration is a Mess too

            Even if you decide to go purist and install no plugins, you’ll still need things like a halfway decent search, filetype recognition, and line numbers. And, once again, Vim actively hates you here. Figuring out what settings are available is hard. Figuring out how to properly write a vimrc is hard. Figuring out how to debug a broken vimrc is hard. Whenever a newbie asks me for Vim help, the second thing I do (after helping) is showing them how to set up their vimrc, because otherwise it will be a long, long time before they discover :set nocompatible.

            Dangerous by Default

            Mapping is cool. It’s a powerful tool. If you write :map b w, you change the meaning of the b key to the w key! Then if you write :map B b, you map the B key to… the w key. Because vim expands mappings by default. What you’re supposed to use is noremap, which is only mentioned offhand as the preferred choice in two lines of the mapping documentation.

            Another one: ctrl-V pastes in most applications. In Vim, it reads your clipboard as a series of keystrokes and executes them. I know why this is the case, and it does have some neat impacts, but it also means it’s possible to accidentally execute a shell script when you’re trying to paste to Vim.

            General Inconsistency Nits

            D is d$, C is c$, but Y is yy. Q kicks you into ex mode. u uses the undo tree, U does not. Counts interact with macros in really weird and nonintuitive ways. '‘s counterpart is `, not ". z and g are chords for some reason, while G is a single command and Z doesn’t do anything (except extend to ZZ). etc etc etc.

            I think of Vim as a disappointed implementation of several brilliant ideas. Sure, it’s powerful, but we shouldn’t pretend it’s problem free.

            1. 2

              Wow, I like vim but this just seems over the top.

              I can’t say that anything in vim has caused me to think of learning its arcane incantations as “game-like” (except of course the excellent Vim Adventures)

              As for new users, vimtutor will teach you the basics but this downplays exactly how slow you’ll be until you’ve committed to muscle memory the various keys and their uses.

              1. 2

                If you sit down and spend 15 min you can get started using vim just as well as you’d use leafpad. The main things you need to know to get started is how to enter insert mode (i), how to get to command mode (esc), and how to save and exit. (x)

                It does take longer to do more advanced things, but most of those advanced things are not even available in other more simple editors, so its not like you are suddenly way behind a nano user.

                1. 2

                  Hahaha I’ve been using vim for years and have been typing :wq all this time.

                  1. 2

                    ZZ is probably the fastest way, if you haven’t used that.

                  2. 1

                    I think you mean :x<cr> :P