Vim is an awesome editor; the efficiency and power of its key bindings are astounding. Furthermore, the core functionality of Vim can be customized and extended through plugins. While there are a plethora of plugins that exist, we’re confident that you’ll use the following seven every day.
Before Pathogen, managing plugins in Vim was a chore. If you were lucky, plugins would be distributed as a “vimball” archive. However, files usually had to be manually copied and maintained. Pathogen modifies that way plugins are loaded, isolating them into their own directories. This makes installation, upgrading and removal fast and easy.
Ctrl-P is an extremely powerful finder for Vim and is without a doubt the plugin you’ll rely on the most. It supports regular expressions and has amazing fuzzy partial matching. For example, to find “src/util/misc.py,” Ctrl-P allows you to search by “misc,” “s/u/misc” or even “srcutilmisc.” It automatically detects your project’s root directory, enabling you to find files at insane speeds. Once you locate files, Ctrl-P also provides quick key bindings to open the file in a new tab or split.
3. Indent Guides
Indent Guides draws vertical stripes, enabling you to quickly see where indented blocks begin and end. While this is helpful in writing clean and properly indented code in any language, it is especially useful for Python, where white space is extremely important. Before this plugin existed, this was accomplished by manually editing Vim’s syntax files to add indentation guides, but this plugin is much easier and faster.
Syntastic is a syntax-checking plugin for Vim, supporting close to a hundred languages and data formats. It highlights errors in the gutter and provides full error messages as hover balloons. Syntactic provides a great first-line defense against careless mistakes. This is especially useful for those who constantly switch between programming languages, it is easy to confuse syntaxes.
Fugitive provides a Git wrapper inside Vim. From within the editor, the plugin enables you to easily switch branches, see a list of changed files, stage changes and create commits. The ability to view diffs and blames (change logs) of the current file as vertical splits is especially powerful. These splits are synchronized and scroll with the main editor.
6. Git Gutter
Git Gutter displays a git diff in the left gutter of the editor. The diff indicates which lines have been inserted, modified or deleted. While Fugitive provides detailed diffs, this plugin’s overview is extremely useful in quickly viewing a file’s changes at a glance. In addition, it offers a convenient way to stage and revert individual hunks.
Airline is an extendable status line for Vim. Many of the Vim plugins listed here are able to hook into Airline and display additional information such as the current Git branch, status of modifications and count of syntax errors. While Airline works and looks great on its own, special fonts (for example, “Inconsolata for Powerline”) provide enhanced visuals and graphics.
While there are many more Vim plugins, these are seven you’ll use every day for development. What about you? What plugins do actually you use most often?