vim-pathogen README

The project's README from github.com/tpope/vim-pathogen. As one markdown file: README.md.

pathogen.vim

Manage your 'runtimepath' with ease. In practical terms, pathogen.vim makes it super easy to install plugins and runtime files in their own private directories.

For new users, I recommend using Vim's built-in package management instead. :help packages

Installation

Install to ~/.vim/autoload/pathogen.vim. Or copy and paste the following into your terminal/shell:

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

If you're using Windows, change all occurrences of ~/.vim to ~\vimfiles.

Runtime Path Manipulation

Add this to your vimrc:

execute pathogen#infect()

If you're brand new to Vim and lacking a vimrc, vim ~/.vimrc and paste in the following super-minimal example:

execute pathogen#infect()
syntax on
filetype plugin indent on

Now any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the 'runtimepath'. Observe:

cd ~/.vim/bundle && \
git clone https://github.com/tpope/vim-sensible.git

Now sensible.vim is installed. If you really want to get crazy, you could set it up as a submodule in whatever repository you keep your dot files in. I don't like to get crazy.

If you don't like the directory name bundle, you can pass a runtime relative glob as an argument:

execute pathogen#infect('stuff/{}')

The {} indicates where the expansion should occur.

You can also pass an absolute path instead. I keep the plugins I maintain under ~/src, and this is how I add them:

execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}')

Normally to generate documentation, Vim expects you to run :helptags on each directory with documentation (e.g., :helptags ~/.vim/doc). Provided with pathogen.vim is a :Helptags command that does this on every directory in your 'runtimepath'. If you really want to get crazy, you could even invoke Helptags in your vimrc. I don't like to get crazy.

Finally, pathogen.vim has a rich API that can manipulate 'runtimepath' and other comma-delimited path options in ways most people will never need to do. If you're one of those edge cases, look at the source. It's well documented.

Native Vim Package Management

Vim 8 includes support for package management in a manner similar to pathogen.vim. If you'd like to transition to this native support, pathogen.vim can help. Calling pathogen#infect() on an older version of Vim will supplement the bundle/{} default with pack/{}/start/{}, effectively backporting a subset of the new native functionality.

Runtime File Editing

:Vopen, :Vedit, :Vsplit, :Vvsplit, :Vtabedit, :Vpedit, and :Vread have all moved to scriptease.vim.

FAQ

Can I put pathogen.vim in a submodule like all my other plugins?

Sure, stick it under ~/.vim/bundle, and prepend the following to your vimrc:

runtime bundle/vim-pathogen/autoload/pathogen.vim

Or if your bundles are somewhere other than ~/.vim (say, ~/src/vim):

source ~/src/vim/bundle/vim-pathogen/autoload/pathogen.vim

Will you accept these 14 pull requests adding a .gitignore for tags so I don't see untracked changes in my dot files repository?

No, but I'll teach you how to ignore tags globally:

git config --global core.excludesfile '~/.cvsignore'
echo tags >> ~/.cvsignore

While any filename will work, I've chosen to follow the ancient tradition of .cvsignore because utilities like rsync use it, too. Clever, huh?

What about Vimballs?

If you really must use one:

:e name.vba
:!mkdir ~/.vim/bundle/name
:UseVimball ~/.vim/bundle/name

Why don't my plugins load when I use Vim sessions?

Vim sessions default to capturing all global options, which includes the 'runtimepath' that pathogen.vim manipulates. This can cause other problems too, so I recommend turning that behavior off:

set sessionoptions-=options

Contributing

If your commit message sucks, I'm not going to accept your pull request. I've explained very politely dozens of times that my general guidelines are absolute rules on my own repositories, so I may lack the energy to explain it to you yet another time. And please, if I ask you to change something, git commit --amend.

Beyond that, don't be shy about asking before patching. What takes you hours might take me minutes simply because I have both domain knowledge and a perverse knowledge of Vim script so vast that many would consider it a symptom of mental illness. On the flip side, some ideas I'll reject no matter how good the implementation is. "Send a patch" is an edge case answer in my book.

Self-Promotion

Like pathogen.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

vim-pathogen (tpope/vim-pathogen)

Searching Database…

这是什么东西?pathogen.vim 是一个 Vim 插件,用来管理你的 'runtimepath',让每个插件和运行时文件都能装在自己独立的目录里,安装起来非常省事。
它是一个独立的程序,还是装在 Vim 里面的东西?它装在 Vim 里面:就是一个单独的 Vim 脚本,随编辑器一起加载,并接管 Vim 查找和加载其他所有插件的方式。
除了 Vim 本身,我还需要装别的东西吗?不需要——它是一个自包含的 Vim 脚本,没有任何外部依赖;插件本身只需要克隆或解压到你的 bundle 目录里就行。
pathogen 现在还是管理 Vim 插件的推荐方式吗?对新用户来说不是了——作者推荐改用 Vim 自带的包管理功能;在 Vim 8 及以上版本中,原生系统的用法差不多,而 pathogen 可以把其中一部分功能带给老版本的 Vim。
它在 Windows 上也能用吗?可以,但有一个小改动:凡是说明里写 ~/.vim 的地方,都要换成 ~\vimfiles——autoload 脚本和你的 bundle 目录都是如此。
它用的是常见的开源许可证吗?不是常见的那几种——它按照 Vim 本身的条款发布,所以可以免费使用,但许可证是 Vim 自己的。
pathogen 装好之后,我怎么添加插件?把每个插件解压或用 git clone 放到 ~/.vim/bundle 下面各自的子目录里——pathogen 会把那里的每个目录都加进你的 'runtimepath',插件就会自动加载。
我需要为每个插件的文档手动运行 :helptags 吗?不用——pathogen 自带一个 :Helptags 命令,可以一次性为 'runtimepath' 上所有目录生成帮助标签,你甚至可以在 vimrc 里调用它。
我可以把插件放在 ~/.vim/bundle 以外的地方吗?可以——给 pathogen#infect() 传入一个相对的 glob 模式,比如 'stuff/{}',甚至绝对路径也行;{} 表示目录名会被展开到这个位置。
为什么恢复 Vim 会话后我的插件都不见了?Vim 会话会保存所有全局选项,包括 pathogen 所操作的 'runtimepath'——在 vimrc 里加上 'set sessionoptions-=options' 就能避免这个问题。
What are similar projects?vim-plug, vimrc, vim-fugitive, Vundle.vim, lazy.nvim, tpm, vis, vim
Creator
tpope
Size
0.1 MB
Stars
12.1K
Updated
CommitAug 24
Age
16y
Commits · 90 Days