Skip to content

Instantly share code, notes, and snippets.

@orivee
Forked from romainl/gist:9970697
Created August 4, 2018 10:02
Show Gist options
  • Select an option

  • Save orivee/f55556aa80f4758812c452d858915b7d to your computer and use it in GitHub Desktop.

Select an option

Save orivee/f55556aa80f4758812c452d858915b7d to your computer and use it in GitHub Desktop.
How to use Tim Pope's Pathogen

How to use Tim Pope's Pathogen.

I'll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

Prepare your environment.

If they don't exist already, create these two directories:

~/.vim/autoload/
~/.vim/bundle/

Get Pathogen.

Save https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim to

~/.vim/autoload/pathogen.vim

Configure Pathogen.

Put these lines at the top of your vimrc:

execute pathogen#infect()

filetype plugin indent on
syntax on

The two last lines have nothing to do with pathogen but, if you have them in your ~/.vimrc, be sure to put them after the pathogen line. If you don't have those lines, well… add them! What good is Vim without syntax highlighting and filetype detection?

Install a plugin.

We are going to install delimitMate. Once it is installed in ~/.vim/bundle/, you should get:

~/.vim/bundle/delimitMate-master/autoload/...
~/.vim/bundle/delimitMate-master/doc/...
~/.vim/bundle/delimitMate-master/plugin/...
~/.vim/bundle/delimitMate-master/...

Manually:

Unzip delimitMate-master.zip in ~/.vim/bundle/delimitMate-master/.

Gitly, no submodules:

$ cd ~/.vim/bundle
$ git clone https://github.com/Raimondi/delimitMate.git

Gitly, using submodules:

$ cd ~/.vim
$ git submodule init
$ git submodule add https://github.com/Raimondi/delimitMate.git bundle/delimitMate

All methods:

It is recommended to use the :Helptags command, provided by Pathogen, to make the plugin's documentation available.

Update a plugin.

Manually:

Same as installation process.

Gitly, with or without submodules:

$ cd ~/.vim/bundle/delimitMate-master
$ git pull

Both methods:

Use :Helptags to update the index of the plugin's documentation.

Remove a plugin.

Manually and gitly, no submodules:

Simply remove its directory from ~/.vim/bundle.

Gitly, using submodules:

$ cd ~/.vim
$ git submodule deinit -f bundle/delimitMate
$ git rm -rf bundle/delimitMate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment