Ⅰ. 插件描述
Vim plugin that adds the entries in a .gitignore file to 'wildignore'.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'euclio/gitignore-vim-long-live'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'euclio/gitignore-vim-long-live'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'euclio/gitignore-vim-long-live'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/euclio/gitignore.vim
Ⅳ. 文档说明
gitignore.vim
A Vim plugin that automatically adds the entries in a repo's .gitignore file towildignore, meaning that those files do not appear in the wild menu. Plugins
(such as [CtrlP]) that depend on glob() or globpath() will also ignore these
files.
Note: This plugin requires vim to be compiled with Python support.
Fugitive Integration
This plugin uses [fugitive] to detect git repositories. The plugin will then add
that repo's gitignore entries to wildignore.
If you don't want that to happen automatically, create the file.vim/after/plugin/disable-gitignore-fugitive.vim with the single command:
autocmd! wildignorefromgitignore_fugitiveManual Triggering
If you need to invoke the functionality manually, put this in your .vimrc:
map <silent> <unique> <Leader>foo <Plug>WildignoreFromGitignorewhich will look for a .gitignore file in the same directory as the current file.
You can also map against the :WildignoreFromGitignore command that accepts
a directory name as in:
map <Leader>baz :WildignoreFromGitignore /path/to/some/repo<CR>Acknowledgments
This plugin is forked from the gitignore.vim script maintained
by Adam Bellaire on [vim.org], which is in turn based on [this StackOverflow
post][stackoverflow].