美文网首页
vim 插件管理器 Vundle 简易教程

vim 插件管理器 Vundle 简易教程

作者: Apolo_Du | 来源:发表于2019-02-27 13:13 被阅读0次
Life is short, you need vim

前言:

  • 在代码编辑的过程中, 我们常常要使用 "", (), [], {} 等符号来包围一个变量或表达式, 或者是删除文本周围的包围符号.
  • 这样的操作即使是使用 vim 提供的 { command + text objext/motions } 操作来实现, 仍然会十分繁琐. 于是我们会需要借助 vim-surround 这样的插件, 来简化操作以提高效率, 做一个lazy coder. 在这个需求下, 使用vim插件管理器来快捷地管理对应插件就变得十分有必要.
  • 本文将会讨论vim插件管理器 vundle 的安装和使用.

vundle

安装 vundle

  • 使用 git 克隆到本地
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

使用 vundle 安装vim插件

  • 流程简述
    要使用 vundle 安装vim插件, 首先需要在 vundle 的配置文件中定义/输入所需的插件, 然后使用 vim 命令来完成安装.

  • 配置vundle插件
    将以下内容复制为 ~/.vimrc 文件, 然后根据自己的需求来替换定义插件的示范文本.

set nocompatible " be iMproved, required
filetype off " required



" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vimcall 
vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')


" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'


"--------------------------------------- 定义插件的示例 ---------------------------------------

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.


" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'


" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'


" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'


" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'


" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.


Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}


" All of your Plugins must be added before the following line
"--------------------------------------- 定义插件结束 ---------------------------------------

call vundle#end() " required


filetype plugin indent on " required
  • 添加 vim 插件到配置中 ( 以 vim-surround 为例) :
    将这一行复制到 .vimrc 的插件定义部分
 Plugin 'tpope/vim-surround'

  • 执行安装:
    进入 vim
    键入以下命令
:PluginInstall
// 或
:PluginUpdate

结语😁

至此, 我们就成功地通过 Vundle 添加了一个 vim 插件, 如果要使用其他的 vim 插件管理器 (例如 vim-plug) 来管理 vim 创建, 同样需要进行上文中的类型配置, 具体的操作请参考相应的 github repo.

相关文章

  • vim 插件管理器 Vundle 简易教程

    前言: 在代码编辑的过程中, 我们常常要使用 "", (), [], {} 等符号来包围一个变量或表达式, 或者是...

  • vim插件相关笔记

    vim插件管理 vim拾遗 q: 显示 vim 命令历史 插件安装 vundle 插件管理器 插件收藏 NERD-...

  • vim插件管理

    vundle vundle是vim中很好的插件管理器,安装方法: YouCompleteMe YouComplet...

  • vim的插件管理:Vundle

    简介 Vundle 是 Vim bundle 的简称,是一个 Vim 插件管理器,Vundle的github地址和...

  • 使用Vim插件管理器Vundle

    Vundle的github地址 Vundle是Vim的插件管理器,官方Github地址是:Vundle 安装Vun...

  • Vim插件管理器Vundle使用

    Vundle Vundle 是vim的插件管理器, 有了Vundle,vim安装和更新包这种事情都变得十分简便。 ...

  • vim插件

    插件管理器 Vundle vim的插件管理器 我自己的配置信息 效果如下

  • Vundle-Vim插件管理器

    Vundle是一个基于Git的Vim插件管理器,使用Vundle可以简化Vim的插件安装过程,不再需要手动去拷贝插...

  • Termux配置使用(三)

    安装vim 提供对于python的支持 vim插件管理 这里使用的插件管理器是vundle安装git 安装插件管理...

  • Vim+Vundle+NERDTree

    vim编辑器下,使用Vundle插件管理器安装NERDTree树形目录插件。操作环境: 1. 安装vim 2. ...

网友评论

      本文标题:vim 插件管理器 Vundle 简易教程

      本文链接:https://www.haomeiwen.com/subject/fwnxuqtx.html