In this chapter, we will be looking at how we can add external plugins to vim. vim has its own programming language for writing plugins, which we saw a glimpse of when writing the vim configuration file. Luckily, we won't have to learn all of that, because most of the stuff we can think of already has a plugin out there. To manage plugins. Let's install the plugin manager pathogen. We open the site and follow the installation instructions.
As you can see, it's a one line command. And after it finishes, pathogen to the vim configuration file, okay, most either show a tree layout of the folder structure in parallel with the open files. vim can do this also. And the simplest way to achieve this is by installing the plugin named nerd tree we open this site and follow the instructions for installing Now we should be all set. Let's open a file and type in our tree. And we see here a tree like structure of our current folder, where we can browse and open your files.
If you want vim to replace our either, this is certainly a mandatory plugin. Another awesome plugin that comes in really handy is called snip mate, and it's used for writing code snippets. To install it, we go to the link on the screen and follow the instructions. As we can see, before installing snip mate, there is another set of plugins that need to be installed. If we take a look at the readme, we can see an example for C files which has auto completion for the for keyword. Let's open a file with the extension by Before and heat up, we can see the autocomplete working.
We have also installed the vim snippet package, which comes with lots of snippets for different languages. If we take a look in its directory, we can see lots of snippet files. Let's check the JavaScript one. and here we can see all the snippets available. Type fun and hit tab for the function autocomplete. There are lots of plugins out there, people made all sorts of plugin packs that are guaranteed to put your vim on steroids.
One cool project is this one. It's nicknamed the ultimate vim plugin pack and it basically has plugins and keyboard shortcuts for everything. This is for the more advanced users. So Be sure to understand the basic concepts before jumping to plug in packs. Remember, the best way to learn is to install plugins manually and play with them one by one.