配置VIM插件,例如侧边栏、欢迎页、语法支持增强等

可以使用vim-plug管理VIM插件,这是GitHub地址:junegunn/vim-plug: 🌺 Minimalist Vim Plugin Manager (github.com)

使用curl命令安装vim脚本到当前用户目录下(~/.vim/autoload/plug.vim

  • curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    

修改 ~/.vim/vimrc文件,在头部添加如下内容。在 call plug#begin()call plug#end()之间直接放入要添加的插件即可。

  • call plug#begin()
    " The default plugin directory will be as follows:
    "   - Vim (Linux/macOS): '~/.vim/plugged'
    "   - Vim (Windows): '~/vimfiles/plugged'
    "   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
    " You can specify a custom plugin directory by passing it as the argument
    "   - e.g. `call plug#begin('~/.vim/plugged')`
    "   - Avoid using standard Vim directory names like 'plugin'
    
    " Make sure you use single quotes
    
    " Initialize plugin system
    " - Automatically executes `filetype plugin indent on` and `syntax enable`.
    call plug#end()
    

例如加入这几个插件

  • call plug#begin()
    " The default plugin directory will be as follows:
    "   - Vim (Linux/macOS): '~/.vim/plugged'
    "   - Vim (Windows): '~/vimfiles/plugged'
    "   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
    " You can specify a custom plugin directory by passing it as the argument
    "   - e.g. `call plug#begin('~/.vim/plugged')`
    "   - Avoid using standard Vim directory names like 'plugin'
    
    " Make sure you use single quotes #确保使用单引号!!!
    
    " On-demand loading
    Plug 'mhinz/vim-startify' " 修改vim欢迎页,能快速进入最近的编辑文件。
    Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' } " 侧边栏,能浏览目录结构。
    Plug 'chr4/nginx.vim' " 增强对Nginx配置文件的语法支持
    
    call plug#end()
    

最后,重新打开vim,并执行 :PlugInstall 命令来安装插件即可。具体方法如下。

  • 在这里插入图片描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值