vim插件管理
最近使用vim写bash shell脚本的时候发现默认的vim现实的状态信息不够全,因此想通过安装插件来实现,这里记录一下自己安装安装过程,以后不需要在使用时再去百度了
插件管理器: vim-plug
vim版本: version 8.1
安装方法:
下载vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
添加配置信息
新建~/.vimrc,并添加如下内容:
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline' # 这一段代码是我添加的插件
call plug#end()
两个
call中间添加你需要添加的插件,例如,我添加的vim-airline这个美化状态栏信息插件
安装插件
终端输入vim,打开vim,然后输入:PlugInstall进行安装
如果显示Done,则代表插件安装成功
以上就完成来一个插件的安装,如果需要其他插件,在call代码块中间添加其他插件就可以了
可以参考官方网页了解详细信息:https://github.com/junegunn/vim-plug
如下是从官网上拷贝的一些个人认为有用的信息,作为自己使用时的参考:
Commands
| Command | Description |
|---|---|
PlugInstall [name ...] [#threads] |
Install plugins |
PlugUpdate [name ...] [#threads] |
Install or update plugins |
PlugClean[!] |
Remove unlisted plugins (bang version will clean without prompt) |
PlugUpgrade |
Upgrade vim-plug itself |
PlugStatus |
Check the status of plugins |
PlugDiff |
Examine changes from the previous update and the pending changes |
PlugSnapshot[!] [output path] |
Generate script for restoring the current snapshot of the plugins |
Example: A small sensible Vim configuration
call plug#begin()
Plug 'tpope/vim-sensible'
call plug#end()

浙公网安备 33010602011771号