2. .vimrc pruning

The first thing I do when I start a Vim update/cleaning session is go into my .vimrc file and pull out stuff I don’t understand or remember. Usually this is from some random thing I heard of somewhere and wanted to try, or from some previous hack regarding plugins.

It feels amazing to start with a completely new config file.

Neovim uses init.vim as its $VIMRC file instead of .vimrc.

Ideally I like to remove any config setting in there that I don’t understand, but over time these grow so as to make that difficult. This year, though, I really did it because when I moved to Neovim I started from an empty conf file and only added very few things to it.

3. Updated Plugin management with minpac

Ok, so this is the craziest thing. Plugin management in Neovim (using Minpac) is Perfection. It’s Valhalla.

Vim 7.x preferred Peruvian Chickens from the mountain regions.

In previous versions of Vim you had to sacrifice all sorts of animals to be able to manage plugins. You could do things manually, you could use Pathogen, you could do custom stuff—etc. But it was all kind of gross.

With Minpac, you just put the plugin’s git repository in your conf file, and it manages installation and updates for you automatically.

Even with the latest upgrades in Version 8, you still had management problems with plugins that you had in plugins/bundle/something/something/ because if they were git repositories (why wouldn’t they be) then you often got errors when you tried to update them.

The only plugin you have to actually install is Minpac.

Well, now there’s a new system altogether, called Minpac. It’s spectacular. For plugin management you just point to your plugins’ GitHub repos in your $VIMRC and it does everything for you—including installation and upgrades. All you do is run a simple command and they either install or update based on whether they’re already there.

Vim plugin management using Neovim/Minpac

Minpac is what package management should have been all along.

In fact, you don’t even have to start with plugins installed (other than Minpac) since Minpac installs them all into its own folder structure and handles everything.

4. A few new tricks

Ok, so in addition to the big things (Neovim, new plugin management, and a new config), here are a few nuggets of goodness for my $VIMRC I’ve picked up in the last few days of studying.

# Copying and pasting from the system clipboard

You can also combine both clipboards into one with a setting, but it’s better to have the option and use these mappings.

It’s always been annoying to have two separate clipboards—one in Vim and one in macOS (or whatever OS you’re on). Well now you can deal with them both independently or copy and paste between them.

vnoremapy"+y

# Changed my leader key to "'" (single quote)

I’m still chasing the perfect leader key.

I’m a huge fan of using leader shortcuts, but for some reason the SPACEBAR wasn’t working for me. So I changed it to ' a single quote, which is one key to the right of my right hand’s pinky finger. Super efficient.

This just makes it easier to enter commands from within Vim. When sitting normally on the keys, my right pinky is already sitting on the ;, and now it’s just one pinky stroke instead of a SHIFT-; chord.

# Added a few key leader shortcuts

I’m a bit torn on these because certain replacements feel like blasphemy.

And finally I added a few new leader chords for doing regular Vimmy things, like saving, saving and exiting, and exiting without changing anything.

Save file (leader-w)

Save and exit (leader-e)

Exit without saving (leader-q)

Summary

So this was a big update! Here’s what we accomplished.

I’m now using Neovim instead of Legacy Vim.

I’m sporting a completely new $VIMRC that I fully understand every single line of.

I’m now using a completely new way of managing plugins that handles installation and updating of plugins all through the $VIMRC.

Notes

There is some wrangling that needs to be done to get Neovim installed and configured, but it’s outside the scope of this article. It’s not too terribly difficult really; it’s mostly just realizing that Neovim works off of a init.vim file instead of .vimrc, and that it uses a different directory structure. Other than that most stuff is pretty close to identical.

I’ll be adding a lot more back into my config, but this is exactly how I wanted to start—lean and mean.