Installing the Pathogen Plugin Manager
Learn how to integrate the Pathogen plugin manager in order to make the plugin installation process more efficient.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

Now if you've been following along with this vim plugin section, then you may have kinda been wondering about why we have to do code or integrate code like this. Where if I come down to the bottom of the file you can see that here we have all of these calls to runtimepath.

large

So we have a plugin for Control + P, we have a plugin for nerdtree, for endwise, supertab, all of those. And the reason why I did that is because I wanted to show you how this manually happened. This is not magic this is simply you calling a vim file that's it.

However this is not the way you usually are gonna want to do this. It's good for learning however there's actually a lot better way of doing it and that's by using a plugin manager. Now with plugin managers for vim, there very likly and it's because really all the doing is giving a auto load kind of mapping for you.

And the one we're gonna use is called pathogen and I have it open right here.

large

And so what pathogen does is it simply gives you a runtime path that you can do. So just like we have all of those manual ones, what pathogen does is it looks inside of your .vim/bundledirectory and then it just loads all those for you so you don't have to manually do it.

So the way you can integrate this is come and grab this code right here.

large

I already have this on my system so I don't need to run it. But if you go to the link in your guide copy all of this code just this code right here. Come in and paste it and then what this is going to do is it's going to create a directory if it doesn't already exist called auto load and then vim bundle. And then it's going to pass in this path to vim, or to pathogen.vim and then it's gonna go and grab and download that for you.

The really cool thing is after we've integrated this all we have to do is come down to where it says runtime path manipulation and call execute pathogeninfect(). So I'm gonna copy this and let's come back to our vim RC file and I'm actually gonna put this up in the general config. I'm gonna come here and paste this in just because I feel like this is such an important thing it should go in our general configurations, I didn't put it there before because I didn't want it to confuse you, and so I wanted to save this until the end.

Now with this in place let's actually go down and we can get rid of all of this code. So I can get rid of this, get rid of this and I believe that those are the only spots where we're calling that runtime.

large

So now if I save this we can open up that ruby file and let's test this out and see if everything's still working. So if I hit Control + P, I have all of my cool Control + P, fuzzy search here. If I scroll down to the end and type in something I have all of my auto complete. If I type def asdf it gives me my end y so everything is still working perfectly.

And now as you can see we have a much cleaner looking vim RC file and in the final version of the code that I'm going to put up to GitHub that you're gonna have access to, it's gonna give you to this version that's much cleaner. So make sure you look for the final commit that's going to include all of the plugins along with pathogen instead of the manual calls.