Vim: Plugins
Plugins are an area where the differences between Vim and Neovim are striking. Not just in how the plugins operate, Neovim forced a little crisis in my philosophy of Vim minimalism.
My use of Vim has always leaned towards focussing on the core Vim functionality and using a minimal number of plugins (you can see those below). I tended to primarily use Vim for editing, quickly moving between files, and the coding basics of compiling, working through errors using the quickfix list, etc. I barely even used completion as it was never quite smooth enough for me. A lot of my workflow happened outside of Vim at the command line (testing, Git, etc.) and occasionally in an IDE for debugging.
Deep down I knew I could be a little more productive, and I even wrote Vim plugins from time to time to help make repetitive tasks easier, but Vimscript is not the easiest language to grok, and it was not like I was not getting stuff done, and I felt that my Vim mastery was decent, so I left it alone. I was happy I tell you.
So, I ignored Neovim and whatever that community was up to for 8 years. I was happy I tell you.
Then I stumbled across the guy called The Primeagen on YouTube. Love this guy. I never imagined that watching someone else code would be fun (I am not a fan of pair programming), but, damn it, it was addictive. He is a big Vimmer and had recently made the switch to Neovim. It was just so clear that this was better.
Why is it better (at least for me)? Neovim seems to be more focussed on extensibility and Lua is used as the scripting engine. Lua is a great (and small) scripting language that I have previously used for routing configuration and it is widely used as an embedded scripting engine in many successful software products, it’s just a great tool for the job. I can see myself digging in and learning Lua and the Neovim plugin framework deeply so I can make my developing workflow as smooth as possible.
And that’s the rub. I find myself using many more plugins and the between Neovim itself still evolving and a bunch of plugins that don’t seem to mind making breaking changes, you can find yourself tinkering a lot, like days and days a lot. I love it, it’s fun, but it’s not what I get paid to do. I’m not sure I can call myself a Vim minimalist at the moment, maybe after a while it will settle down and I can find my small set of plugins that just work for me, but even it that happens I expect I will be doing more tinkering in the future. And that’s OK, I will find the balance and I do believe I will be more productive.
Vim PLugins
That being said, these are the plugins that I use:
- vim-vinegar: A thin wrapper around
netrw
that makes the interaction a little smoother. - ctrlp: Fast file/buffer searching/opening.
- vim-unimpaired: Adds useful, consistent, and well thought out navigation aids.
- vim-commentary: Makes commenting code in a variety of languages easier.
- vim-go: Support for working with Golang.
- vim-fugitive: Support for working with Git.
Plugin Manager
Since Vim8 I have not used a plugin manager. I do lose out on some niceties,
like automatic updates, but I like the simlicity of one less moving part in my
setup and it’s not big deal to update when you need to (it’s literally running
git pull
).
Plugin Installs
All the plugins I use are hosted on GitHub are are installed using git clone
.
As an example, this is how I would install vim-commentary
.
cd .vim/pack/plugins/start/
git clone https://github.com/tpope/vim-commentary.git
Restart Vim and you are done. Doesn’t get much easier than that.
Need to upgrade?
cd .vim/pack/plugins/start/vim-commentary
git pull
It’s really that simple.
Updating Help
I have found that after installing a new package that the help is not automatically available (maybe this is another nice things that the package managers did?). Anyway, running the following command seems to do the trick.
:helptags ALL