DEV Community

Discussion on: Vim won't make you a more productive developer

Collapse
 
_nwinant profile image
Nā·thən Wī·nənt

IME, vi[m] has exactly one killer feature: ubiquity. You can rely on it being present on any *nix installation, and it's often in windows cygwin installations.

If you're pretty much always working on the same local machine, vim probably doesn't make a ton of sense for you. But if you find yourself not-infrequently using random machines, or if you're frequently working on machines over ssh, then vim gets you a lot of bang for your buck... up to a point.

IMO, there are probably only 2-3 dozen things in vim that are worth internalizing: basic movement between files/buffers, movement within a buffer (by char, by word, to beginning/end of a line, up/down by page or half page, to top/middle/bottom of screen, to beginning or end of buffer), region selection, cut/copy/paste, indent/outdent search/replace (including basic regex), and of course how to save & exit. Also, visual (rectangular) selection is incredibly handy every once in a while. That handful of things will comfortably cover 99% of the cases where vim is best used: small files, remote machines, and fresh installations.

In terms of ubiquity, plugins can easily become a trap. Relatively superficial things like syntax highlighting are probably fine, but anything beyond that is going to trip you up when you've remoted into a fresh install and suddenly discover that, e.g., there's no autocompletion. Things like that can totally mess with your muscle memory and your workflow.

If you want to take things a step further, remember that *nix itself is a reasonably complete toolchain/dev environment. Get comfortable with other command-line utilities (grep, find, etc.) and GNU screen (this is better than other multiplexers like tmux, IME, only because of its relative ubiquity) -- this will allow you to create a virtual workspace with multiple shells, all of which will survive connection outages and which can be accessed by multiple client machines. It also makes it easy to switch between shell(s) running vim and others in which you're running linters, compilers, etc. -- again, there are probably only 2-3 dozen things worth internalizing about screen; after that you're into diminishing returns. Trying to force vim to be everything goes against the basic Unix philosophy of having a bunch of relatively small, focused tools that are used in concert with each other -- it can be done, but it's inefficient.

In my mind, vim is like a good Swiss army knife, while IDEs are like a well-equipped work bench. A little knowledge of how to use a pocketknife can take you pretty far, if you're realistic about its limits.