4 Vim Plugins to Boost Your Programming Efficiency
Vim is awesome, but you only get out what you put into it
It includes only the bare essentials by default and can run circles around other bloated IDEs. The list of reasons why you should switch is endless, but if you still need a nudge in the right direction here are 3½ Reasons Why You Should Be Using Vim.
Sometimes you need a functionality that Vim doesn’t offer. This is where plugins come into play. Below I’ve put together a list of some ultra useful plugins for Vim that you should be investing time in.
Grab your favorite plugin manager (mine’s Pathogen) and let’s get this show on the road!
1. Vim Fugitive
Imagine for a moment you’re editing a source file with Vim and you see something…odd.
“Who wrote that!?” You ask yourself, wondering why anyone in their right mind would construct such an abomination. Naturally, if the file is in source control you might first start by using
git blame to see who the author is.
If you’re using Vim Fugitive you don’t even have to quit Vim to see the author. You don’t even have to lose your current line number! You could simply issue
Gblame and then a list of authors pops open on the left to show you the offending developer. Magic!
2. fzf (fuzzy finder)
fsf is fuzzy search!
Don’t know what that is? Well, think of the last time you forgot where or even what something was. You remember the first few characters of the name but have no clue where you saw it.
Was it in
lib ? What about 15 directories down in the depths of this strange repository?
Fuzzy finder lets you search for “approximate string” names and get back the closest results. This is what it looks like inside Vim:
Installing fzf is super easy, especially if you’re using Vim Plug, but if you’re on the Pathogen side of the fence it takes a few more steps. Follow along through the fzf GitHub instructions and you’ll be fuzzy searching in no time.
Lightline is extremely straightforward. It replaces the status bar at the bottom of Vim with a themed version that you can customize. One immediate benefit of using Lightline is that you get a more visual indicator of your current editing mode.
Lightline is highly customizable. With this plugin, you can add your own footer-of-functionality at the bottom of Vim.
Want to know what Git branch you’re on? Done!
Want the text output of a shell script displayed at the bottom? Sure!
You can even change the colors and themes to your heart’s content. Powerline is the default theme, which looks great for most Vim themes, but there are several other ones you can easily change to.
NERDTree plugin provides something that other IDEs take for granted. Today if you use any of the modern IDEs like Visual Studio Code, Atom or Sublime Text then you have access to a directory tree by default.
In Vim, adding a directory tree is accomplished by adding this amazing plugin. NERDTree has been around for a while and is arguably the de facto tree plugin for Vim.
You can trigger NERDTree in many different ways depending on your development style, but its easiest to map it to a key combination and the tree pops open.
How do I navigate this tree without a mouse!?
Worry not! NERDTree is very intuitive and if you already use panes and splits in Vim then you’ll be right at home. You can switch back and forth between the tree and your primary window — it’s business as usual. Navigate up and down the tree just like the text in a file. When you’re ready to edit a file hit enter.
I hope you’ve enjoyed spending time with me as I take you through some of the most useful Vim plugins around. If you’ve been using Vim for a while you’ve probably come across some even more interesting plugins. Let me know what your favorites are in the comments.