Vim Tips

2018-11-12(Mon)

tags: Vim

I've used vi, Vim, and now NeoVim for approximately 20 years. When I started using it, I hated it. Passionately. But at the time, I knew vi was essential to being a System Administrator: it was always installed on Unix systems, and a lot of the time it was the only editor you could count on being available. So I gritted my teeth and made myself use it (and nothing else) for a month (yes, it takes that long to start forming the muscle memory that makes it possible to use vi with any fluency). At the end of the month I still didn't like it - but I'd come to realize that there was an insane amount of power hiding behind that obnoxious and counter-intuitive facade.

I'm not the first to offer a series of Vim tips, nor will I be the last. And this won't even be the best of them. But writing them will help me remember what I know and learn new stuff - and may even help people learn more about what is now my favourite editor.

I use - and very strongly recommend - NeoVim. 30% less code than Vim, totally feature- and script-compatible, and we finally have a fully functional terminal emulator. And it's available as a package for almost all Linux distros and Mac (through brew).

If a tip interests you, read it carefully ... and then use it. A lot. (Neo)Vim is all about muscle memory: doing something until it becomes second nature to your fingers.

Categories

For the unsure:

Beginner: you've been using Vim less than a month and/or can't automatically use 'hjkl' for movement.

Beginning Intermediate: you've passed your first month, but that config file still looks damn confusing.

Advanced Intermediate: your ~/.vimrc exceeds 100 lines.

Advanced: you write VimScript.

Very Advanced: you put in (Neo)Vim pull requests. I'm not at this level and won't be writing in this category.


As Published