【英文】Vim安装第三方插件

Preface

Installing and managing third-party Vim plugins through Vundle

Preparation

  • Use Brew to install Vim instead of the system default Vim
1
brew install vim

Setting up the environment

Create a directory to store Vim plugins

1
mkdir -p ~/.vim/bundle/

Download the Vundle project

  • Download the Vundle project to the plugin directory
1
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Modify the configuration

  • Add the configuration to the Vim configuration file
1
2
3
4
5
6
7
8
9
10
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'

" Add plugin list here

call vundle#end()
filetype plugin indent on

Format to append plugin list

Plugins from GitHub
1
Plugin 'username/repository'
Plugins from vim-script
1
Plugin 'plugin name'
Plugins from other Git remote repositories
1
Plugin 'git://xxx/xxx.git'
Plugins from local Git repositories
1
Plugin 'file://directory path'

Installing plugins

  • Install all the plugins configured in the configuration, including Vundle itself

  • Enter Vim’s command line mode

1
:PluginInstall

Installing plugins directly outside of Vim

1
vim +PluginInstall +plugin name

Updating and installing plugins

1
:PluginList!

Listing all configured plugins

1
:PluginList

Updating plugins

1
:PluginUpdate

Searching for plugins

<name>: Plugin name

1
:PluginSearch <name>

Clearing local cache and searching

1
:PluginSearch <name>!

Cleaning up unused plugins

1
:PluginClean

Automatically approve removal

1
:PluginClean!

Conclusion

References

CSDN - unhejing
Github - VundleVim
Github - skywind3000