How to install a vim plugin

vim plugin

  1. Install vim-plug.
  2. Download plug.vim or execute wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim. Or curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  3. Put plug.vim in the autoload directory. If the folder doesn't exist, create one with mkdir ~/.vim/autoload.
  4. Add vim-plug tags in vimrc file and put you'd like to install plugin between these tags. For instance, I want to install nerdtree plugin. The vimrc looks like this. call plug#begin('~/.vim/plugged') Plug 'preservim/nerdtree' call plug#end()
  5. Next, restart vim or execute command so % in the command mode to reload the setting file vimrc.
  6. Run command PlugInstall to install plugins.
  7. :q to leave plugin install window

Remember

If you don't want to install any plugin and commet it in the plug block, it will not take effect. You need to remove this line or move this line outside the plug block.

Related