一句话:放在 ~/.vim/pack/bundle/start/目录下
└── pack └── bundle └── start └── nerdtree-5.3.0
Vim 8+ / Neovim
Version 8 introduces a new packages mechanism that largely replaces the need for existing plugin managers (pathogen, vim-plug, vundle, etc.) at the time of writing (2017).
From the documentation:
A Vim package is a directory that contains one or more plugins
A package directory contains two sub-directories:
start/
- contains plugins that will be automatically loadedopt/
- contains plugins that are loaded on demand with:packadd
It may seem a bit complicated, but in practice all you have to do is add your plugin here:
↓ package name
~/ .vim / pack / bundle / start / some-plugin
↑ packages dir ↑ plugin dir
On Windows: use ~vimfilespack
instead of ~/.vim/pack/
By convention, we've used the package name "bundle" as the directory that will contain all our plugins. You can use any name you want, and you can even put your plugins in separate package directories if you really want to.
Example: Installing sensible.vim
mkdir -p ~/.vim/pack/bundle/start
cd ~/.vim/pack/bundle/start
git clone https://github.com/tpope/vim-sensible.git
On Windows: use ~vimfilespack
instead of ~/.vim/pack/
Next time you start Vim, the plugin will load automatically.
查看插件
" where was an option set
:scriptnames : list all plugins, _vimrcs loaded (super)
:verbose set history? : reveals value of history and where set
:function : list functions
:func SearchCompl : List particular function