vim插件管理器vim-plug
vim插件管理器vim-plug
github网址:junegunn/vim-plug: 🌺 Minimalist Vim Plugin Manager (github.com)
github中有完整的教学,可以登录github自行阅读
定义
A minimalist Vim plugin manager.
一个最小的vim插件管理
下载
linux
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
windows
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
ni $HOME/vimfiles/autoload/plug.vim -Force
使用
原文
Add a vim-plug section to your ~/.vimrc (or stdpath('config') . '/init.vim' for Neovim)
1.Begin the section with call plug#begin([PLUGIN_DIR])
2.List the plugins with Plug commands
3.call plug#end() to update &runtimepath and initialize plugin system
Automatically executes filetype plugin indent on and syntax enable. You can revert the settings after the call. e.g. filetype indent off, syntax off, etc.
由原文可知基础模板为
call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
call plug#end()
colorscheme gruvbox
call 开始与结束一定要写
~/.vim/plugged 将插件放在哪一个目录下
Plug 'morhetz/gruvbox' 下载插件 插件真实地址https://github.com/morhetz/gruvbox
如果真实地址可以访问,则可以下载该插件
colorscheme gruvbox 使用插件
写完后需要
Reload .vimrc and :PlugInstall to install plugins.
重新启动.vimrc
输入命令:PlugInstall
即可下载插件
可能出现的错误
1.插件是由git下载 所有必须安装git
2.git fatal:ambiguous argument HEAD: unknown revision or path not in the working tree.
模糊的参数头,不确定的修改或路径不在工作树种
上面是应为没有配置全局个人信息
git config --global user.email "邮箱"
git config --global user.name "姓名"
上面信息不准确也没关系
3.访问github的网速问题导致下载不下来
可参考下面文章,使用加速器
https://blog.csdn.net/ace1231/article/details/120372571
以上只做一个基础配置
详细的还需要查看github

浙公网安备 33010602011771号