There are more than 4000 Vim scripts out there. This is one of the reasons why Vim is so awesome. However, if you are starting with Vim, you might wonder from where to begin. In this post we are going to talk about 5 plugins that can be found in almost any vimrc.
Surround provides mappings to easily delete, change and add surroundings in pairs. It’s created by Tim Pope, and it’s starred more than 800 times on GitHub.
The best way to explain it is to show some examples:
Go inside the following text and press cs”’:
It changed the double quotes to single. Cool, isn’t it? You can also remove them by pressing
This plugin is really powerful and it can be extremely useful, check the documentation for more examples.
Command-T provides a fast mechanism for opening files and buffers with a minimal effort. Its name comes from the “Go to File” functionality in TextMate, bound to
cmd + t.
Command-T is really advanced and it orders the files in your working directory, when searching, by an algorithm which knows that characters in certain locations should have more weight.
You can check this awesome screencast in order to view it in action.
snipMate is a plugin created by Michael Sanders. It’s an implementation of TextMate’s snippets features in Vim. A snippet is a often-typed text that you can easily insert by typing a word + tab. Here is an example:
1 2 3
By pressing tab, you can switch between the highlighted items and change them.
Syntastic is a syntax checking plugin that runs files through external syntax checkers and displays any resulting errors.
Bufexplorer is a plugin designed to optimise the browsing of Vim buffers. When you invoke it, it renders a sorted list of all buffers that are currently open. After that, you can easily sort, open or delete any of them.
You can open Bufexplorer by using one of the default public interfaces:
1 2 3
What’s your favourite Vim plugin? What are the most useful plugins that you know? Is there a plugin that you consider as really useful, but not quite popular? Let us know in the comments.