DEV Community

Cover image for Pathogen - The Best Plugin Manager for vim
Preslav Mihaylov
Preslav Mihaylov

Posted on • Updated on • Originally published at pmihaylov.com

Pathogen - The Best Plugin Manager for vim

Continuing the Boost your VIM series with the next neat vim plugin - pathogen!

Last time, I showed you one of my favorite bash utilities (which happens to work so wonderfully with vim) - tmux.

This time, I will introduce you to my weapon of choice when it comes to plugin managers.

It's called pathogen. This is the best and yet simplest plugin manager there is.

There are others, like Vundle, which I've tried in the past but none can beat pathogen's simplicity.

It's so simple (in fact, the total source code is ~250 lines), that this will be a pretty simple post as well.

So, if you're ready to hack your VIM with some neat plugins, start with this one and make your life easier.

Introduction

Pathogen is a plugin manager for vim. This allows you to easily install plugins without much hassle.

Normally, you would have to distribute different files of the plugins to different places.

Pathogen does this all for you. All you need to do, is git clone the vim plugin repo in a specified folder (normally ~/.vim/bundle and that's it.

Installation

Taken directly from the original repo:

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Enter fullscreen mode Exit fullscreen mode

Next, add this to your ~/.vimrc:

execute pathogen#infect()

That's it!

How to use

Anytime you would like to try out a new vim plugin run this:

git clone <vim plugin repo> ~/.vim/bundle

For example, if you would like to install Nerdtree, run this command:

git clone https://github.com/scrooloose/nerdtree ~/.vim/bundle

Finally, when inside your vim, in order to populate the vim docs with the new plugin documentation, run :Helptags

After that, all that is left is to configure the specific plugin according to its help page and repo README. If needed.

Conclusion

So there you have it. Your best vim plugin manager. I just love how simple it is.

There is no need to bother with any other once you get this baby going.

For more cool vim plugin showcases, watch this space and subscribe.

Top comments (6)

Collapse
 
fenetikm profile image
Michael Welford

One of the nice things about Vim Plug is that you can do lazy loading which can speed up loading of Vim.

e.g.

Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }

Which means that it won't load NerdTree until NerdTreeToggle is fired.

Collapse
 
moopet profile image
Ben Sinclair

I like using a plugin manager like this where my plugins are defined in my .vimrc because I can bootstrap it from my dotfiles repo without having to add a load of submodules. Makes my repo simpler.

Collapse
 
pmihaylov profile image
Preslav Mihaylov

That's pretty interesting!

I didn't know that.

However, I haven't had any too-long-startup-time issues yet with VIM. But if I do encounter such, I will definitely give it a try! :)

Collapse
 
fenetikm profile image
Michael Welford

Heh well I guess it depends on what "too long" means - for me that is greater than 200ms all up ;)

Collapse
 
rpalo profile image
Ryan Palo

Neat! I'll have to give Pathogen another try, this really clears things up for me.

I found that Vim Plug really works nicely too. And you can just run :PlugUpdate to update all of your plugins!

Collapse
 
pmihaylov profile image
Preslav Mihaylov

Never really used that.

I've been using Pathogen from day 1 and never felt the need to switch to anything else. :)