├── .github └── FUNDING.yml ├── CONTRIBUTING.markdown ├── LICENSE ├── README.markdown └── autoload └── pathogen.vim /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: tpope 2 | custom: ["https://www.paypal.me/vimpope"] 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.markdown: -------------------------------------------------------------------------------- 1 | Follow the commit message guidelines at [commit.style](https://commit.style). 2 | This is an absolute requirement for my repositories, and doing so proves you 3 | actually read the contribution guidelines, which makes for a good first 4 | impression. 5 | 6 | Good commit messages imply good commits. Pull requests should typically be a 7 | single commit, or for the rare complicated case, a series of atomic commits. 8 | If I request a change, use `git commit --amend` or `git rebase --interactive` 9 | and force push to your branch. 10 | 11 | For feature requests, don't be shy about proposing it in an issue before 12 | drafting a patch. If it's a great idea, I might do it for you. If it's a 13 | terrible idea, no patch will change my mind. 14 | 15 | The worst ideas are configuration options. You'll need to provide a great 16 | justification in order to persuade me to take on the maintenance and support 17 | burden it will inevitably entail. See if you can get away with a custom map 18 | or autocommand instead. 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | VIM LICENSE 2 | 3 | I) There are no restrictions on distributing unmodified copies of 4 | pathogen.vim except that they must include this license text. You can 5 | also distribute unmodified parts of pathogen.vim, likewise unrestricted 6 | except that they must include this license text. You are also allowed to 7 | include executables that you made from the unmodified pathogen.vim 8 | sources, plus your own usage examples and Vim scripts. 9 | 10 | II) It is allowed to distribute a modified (or extended) version of 11 | pathogen.vim, including executables and/or source code, when the following 12 | four conditions are met: 13 | 1) This license text must be included unmodified. 14 | 2) The modified pathogen.vim must be distributed in one of the following 15 | five ways: 16 | a) If you make changes to pathogen.vim yourself, you must clearly 17 | describe in the distribution how to contact you. When the 18 | maintainer asks you (in any way) for a copy of the modified 19 | pathogen.vim you distributed, you must make your changes, including 20 | source code, available to the maintainer without fee. The 21 | maintainer reserves the right to include your changes in the 22 | official version of pathogen.vim. What the maintainer will do with 23 | your changes and under what license they will be distributed is 24 | negotiable. If there has been no negotiation then this license, or 25 | a later version, also applies to your changes. The current 26 | maintainer is Bram Moolenaar . If this changes it 27 | will be announced in appropriate places (most likely vim.sf.net, 28 | www.vim.org and/or comp.editors). When it is completely impossible 29 | to contact the maintainer, the obligation to send him your changes 30 | ceases. Once the maintainer has confirmed that he has received your 31 | changes they will not have to be sent again. 32 | b) If you have received a modified pathogen.vim that was distributed as 33 | mentioned under a) you are allowed to further distribute it 34 | unmodified, as mentioned at I). If you make additional changes the 35 | text under a) applies to those changes. 36 | c) Provide all the changes, including source code, with every copy of 37 | the modified pathogen.vim you distribute. This may be done in the 38 | form of a context diff. You can choose what license to use for new 39 | code you add. The changes and their license must not restrict 40 | others from making their own changes to the official version of 41 | pathogen.vim. 42 | d) When you have a modified pathogen.vim which includes changes as 43 | mentioned under c), you can distribute it without the source code 44 | for the changes if the following three conditions are met: 45 | - The license that applies to the changes permits you to distribute 46 | the changes to the Vim maintainer without fee or restriction, and 47 | permits the Vim maintainer to include the changes in the official 48 | version of pathogen.vim without fee or restriction. 49 | - You keep the changes for at least three years after last 50 | distributing the corresponding modified pathogen.vim. When the 51 | maintainer or someone who you distributed the modified 52 | pathogen.vim to asks you (in any way) for the changes within this 53 | period, you must make them available to him. 54 | - You clearly describe in the distribution how to contact you. This 55 | contact information must remain valid for at least three years 56 | after last distributing the corresponding modified pathogen.vim, 57 | or as long as possible. 58 | e) When the GNU General Public License (GPL) applies to the changes, 59 | you can distribute the modified pathogen.vim under the GNU GPL 60 | version 2 or any later version. 61 | 3) A message must be added, at least in the output of the ":version" 62 | command and in the intro screen, such that the user of the modified 63 | pathogen.vim is able to see that it was modified. When distributing as 64 | mentioned under 2)e) adding the message is only required for as far as 65 | this does not conflict with the license used for the changes. 66 | 4) The contact information as required under 2)a) and 2)d) must not be 67 | removed or changed, except that the person himself can make 68 | corrections. 69 | 70 | III) If you distribute a modified version of pathogen.vim, you are encouraged 71 | to use the Vim license for your changes and make them available to the 72 | maintainer, including the source code. The preferred way to do this is 73 | by e-mail or by uploading the files to a server and e-mailing the URL. If 74 | the number of changes is small (e.g., a modified Makefile) e-mailing a 75 | context diff will do. The e-mail address to be used is 76 | 77 | 78 | IV) It is not allowed to remove this license from the distribution of the 79 | pathogen.vim sources, parts of it or from a modified version. You may 80 | use this license for previous pathogen.vim releases instead of the 81 | license that they came with, at your option. 82 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # pathogen.vim 2 | 3 | Manage your `'runtimepath'` with ease. In practical terms, pathogen.vim 4 | makes it super easy to install plugins and runtime files in their own 5 | private directories. 6 | 7 | **For new users, I recommend using Vim's built-in package management 8 | instead.** `:help packages` 9 | 10 | ## Installation 11 | 12 | Install to `~/.vim/autoload/pathogen.vim`. 13 | Or copy and paste the following into your terminal/shell: 14 | 15 | mkdir -p ~/.vim/autoload ~/.vim/bundle && \ 16 | curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim 17 | 18 | If you're using Windows, change all occurrences of `~/.vim` to `~\vimfiles`. 19 | 20 | ## Runtime Path Manipulation 21 | 22 | Add this to your vimrc: 23 | 24 | execute pathogen#infect() 25 | 26 | If you're brand new to Vim and lacking a vimrc, `vim ~/.vimrc` and paste 27 | in the following super-minimal example: 28 | 29 | execute pathogen#infect() 30 | syntax on 31 | filetype plugin indent on 32 | 33 | Now any plugins you wish to install can be extracted to a subdirectory 34 | under `~/.vim/bundle`, and they will be added to the `'runtimepath'`. 35 | Observe: 36 | 37 | cd ~/.vim/bundle && \ 38 | git clone https://github.com/tpope/vim-sensible.git 39 | 40 | Now [sensible.vim](https://github.com/tpope/vim-sensible) is installed. 41 | If you really want to get crazy, you could set it up as a submodule in 42 | whatever repository you keep your dot files in. I don't like to get 43 | crazy. 44 | 45 | If you don't like the directory name `bundle`, you can pass a runtime relative 46 | glob as an argument: 47 | 48 | execute pathogen#infect('stuff/{}') 49 | 50 | The `{}` indicates where the expansion should occur. 51 | 52 | You can also pass an absolute path instead. I keep the plugins I maintain under `~/src`, and this is how I add them: 53 | 54 | execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}') 55 | 56 | Normally to generate documentation, Vim expects you to run `:helptags` 57 | on each directory with documentation (e.g., `:helptags ~/.vim/doc`). 58 | Provided with pathogen.vim is a `:Helptags` command that does this on 59 | every directory in your `'runtimepath'`. If you really want to get 60 | crazy, you could even invoke `Helptags` in your vimrc. I don't like to 61 | get crazy. 62 | 63 | Finally, pathogen.vim has a rich API that can manipulate `'runtimepath'` 64 | and other comma-delimited path options in ways most people will never 65 | need to do. If you're one of those edge cases, look at the source. 66 | It's well documented. 67 | 68 | ## Native Vim Package Management 69 | 70 | Vim 8 includes support for package management in a manner similar to 71 | pathogen.vim. If you'd like to transition to this native support, 72 | pathogen.vim can help. Calling `pathogen#infect()` on an older version of Vim 73 | will supplement the `bundle/{}` default with `pack/{}/start/{}`, effectively 74 | backporting a subset of the new native functionality. 75 | 76 | ## Runtime File Editing 77 | 78 | `:Vopen`, `:Vedit`, `:Vsplit`, `:Vvsplit`, `:Vtabedit`, `:Vpedit`, and 79 | `:Vread` have all moved to [scriptease.vim][]. 80 | 81 | [scriptease.vim]: https://github.com/tpope/vim-scriptease 82 | 83 | ## FAQ 84 | 85 | > Can I put pathogen.vim in a submodule like all my other plugins? 86 | 87 | Sure, stick it under `~/.vim/bundle`, and prepend the following to your 88 | vimrc: 89 | 90 | runtime bundle/vim-pathogen/autoload/pathogen.vim 91 | 92 | Or if your bundles are somewhere other than `~/.vim` (say, `~/src/vim`): 93 | 94 | source ~/src/vim/bundle/vim-pathogen/autoload/pathogen.vim 95 | 96 | > Will you accept these 14 pull requests adding a `.gitignore` for 97 | > `tags` so I don't see untracked changes in my dot files repository? 98 | 99 | No, but I'll teach you how to ignore `tags` globally: 100 | 101 | git config --global core.excludesfile '~/.cvsignore' 102 | echo tags >> ~/.cvsignore 103 | 104 | While any filename will work, I've chosen to follow the ancient 105 | tradition of `.cvsignore` because utilities like rsync use it, too. 106 | Clever, huh? 107 | 108 | > What about Vimballs? 109 | 110 | If you really must use one: 111 | 112 | :e name.vba 113 | :!mkdir ~/.vim/bundle/name 114 | :UseVimball ~/.vim/bundle/name 115 | 116 | > Why don't my plugins load when I use Vim sessions? 117 | 118 | Vim sessions default to capturing all global options, which includes the 119 | `'runtimepath'` that pathogen.vim manipulates. This can cause other problems 120 | too, so I recommend turning that behavior off: 121 | 122 | set sessionoptions-=options 123 | 124 | ## Contributing 125 | 126 | If your [commit message sucks](http://stopwritingramblingcommitmessages.com/), 127 | I'm not going to accept your pull request. I've explained very politely 128 | dozens of times that 129 | [my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 130 | are absolute rules on my own repositories, so I may lack the energy to 131 | explain it to you yet another time. And please, if I ask you to change 132 | something, `git commit --amend`. 133 | 134 | Beyond that, don't be shy about asking before patching. What takes you 135 | hours might take me minutes simply because I have both domain knowledge 136 | and a perverse knowledge of Vim script so vast that many would consider 137 | it a symptom of mental illness. On the flip side, some ideas I'll 138 | reject no matter how good the implementation is. "Send a patch" is an 139 | edge case answer in my book. 140 | 141 | ## Self-Promotion 142 | 143 | Like pathogen.vim? Follow the repository on 144 | [GitHub](https://github.com/tpope/vim-pathogen) and vote for it on 145 | [vim.org](http://www.vim.org/scripts/script.php?script_id=2332). And if 146 | you're feeling especially charitable, follow [tpope](http://tpo.pe/) on 147 | [Twitter](http://twitter.com/tpope) and 148 | [GitHub](https://github.com/tpope). 149 | 150 | ## License 151 | 152 | Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. 153 | See `:help license`. 154 | -------------------------------------------------------------------------------- /autoload/pathogen.vim: -------------------------------------------------------------------------------- 1 | " pathogen.vim - path option manipulation 2 | " Maintainer: Tim Pope 3 | " Version: 2.4 4 | 5 | " Install in ~/.vim/autoload (or ~\vimfiles\autoload). 6 | " 7 | " For management of individually installed plugins in ~/.vim/bundle (or 8 | " ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your 9 | " .vimrc is the only other setup necessary. 10 | " 11 | " The API is documented inline below. 12 | 13 | if exists("g:loaded_pathogen") || &cp 14 | finish 15 | endif 16 | let g:loaded_pathogen = 1 17 | 18 | " Point of entry for basic default usage. Give a relative path to invoke 19 | " pathogen#interpose() or an absolute path to invoke pathogen#surround(). 20 | " Curly braces are expanded with pathogen#expand(): "bundle/{}" finds all 21 | " subdirectories inside "bundle" inside all directories in the runtime path. 22 | " If no arguments are given, defaults "bundle/{}", and also "pack/{}/start/{}" 23 | " on versions of Vim without native package support. 24 | function! pathogen#infect(...) abort 25 | if a:0 26 | let paths = filter(reverse(copy(a:000)), 'type(v:val) == type("")') 27 | else 28 | let paths = ['bundle/{}', 'pack/{}/start/{}'] 29 | endif 30 | if has('packages') 31 | call filter(paths, 'v:val !~# "^pack/[^/]*/start/[^/]*$"') 32 | endif 33 | let static = '^\%([$~\\/]\|\w:[\\/]\)[^{}*]*$' 34 | for path in filter(copy(paths), 'v:val =~# static') 35 | call pathogen#surround(path) 36 | endfor 37 | for path in filter(copy(paths), 'v:val !~# static') 38 | if path =~# '^\%([$~\\/]\|\w:[\\/]\)' 39 | call pathogen#surround(path) 40 | else 41 | call pathogen#interpose(path) 42 | endif 43 | endfor 44 | call pathogen#cycle_filetype() 45 | if pathogen#is_disabled($MYVIMRC) 46 | return 'finish' 47 | endif 48 | return '' 49 | endfunction 50 | 51 | " Split a path into a list. 52 | function! pathogen#split(path) abort 53 | if type(a:path) == type([]) | return a:path | endif 54 | if empty(a:path) | return [] | endif 55 | let split = split(a:path,'\\\@]','\\&','') 250 | endif 251 | endfunction 252 | 253 | " Like findfile(), but hardcoded to use the runtimepath. 254 | function! pathogen#runtime_findfile(file,count) abort 255 | let rtp = pathogen#join(1,pathogen#split(&rtp)) 256 | let file = findfile(a:file,rtp,a:count) 257 | if file ==# '' 258 | return '' 259 | else 260 | return fnamemodify(file,':p') 261 | endif 262 | endfunction 263 | 264 | " vim:set et sw=2: 265 | --------------------------------------------------------------------------------