Configuring Vim

Configuring Vim

A coworker recently said

To change config in vim, you have to be a power user - including understanding how to configure plugins.

I’m sorry to say that he is not alone in this belief.

Vim won’t hold your hand by giving you a bunch of preferences windows with checkboxes to turn functionality on and off. So, yes it is “harder”, but it absolutely does not require “Power User” levels of understanding.

Here’s what it requires:

  1. a question
  2. the ability to use Google.
  3. the ability to copy and paste.
  4. knowing to edit and reload your .vimrc

Let’s work through an example.

A Question

“How do I make Vim’s search case insensitive?”

The ability to use Google

The first search result for that question is this stack overflow question which mentions a few options. The least obscure looking of those is set ignorecase which sounds like exactly what we want.

The ability to copy paste

I’m pretty sure I don’t have to explain that.

Knowing to edit and reload your .vimrc

Paste that line in your ~/.vimrc and then restart Vim.1

Configuring Plugins

How you configure plugins depends on which plugin manager you use. For details see plugins. Most plugin managers are the same though. Follow the install instructions once to set it up. When you want to add a new plugin you add something like Plug 'terryma/vim-expand-region' to your .vimrc and run your plugin manager’s load command.

Conclusion

You really don’t need to be a power user. You just need a question and the ability to follow simple instructions, that are usually just “paste this into your ~/.vimrc”.

Understanding of all the details isn’t required, and realistically it doesn’t doesn’t help much until you advance to the point where you’re creating your own custom functions. But really… Don’t worry. You’ll get there eventually.


  1. There are faster / better / different ways to load changes in your .vimrc file. Having folks restart is just the simplest to explain. The .vimrc post explains the other options.