用Vundle管理Vim插件
2024-10-20 11:50:49
作为程序员,一个好用的Vim,是极其重要的,而插件能够使原本功能羸弱的Vim变得像其他功能强大的IDE一样好用。然而下载、配置插件的过程比较繁琐,大家往往需要自己进行下载/配置等操作,如果还涉及到更新/删除插件,那就更麻烦了。
幸运的是我们有Vundle来管理Vim插件。Vundle本身就是个Vim插件,有了这个插件,我们只需要配置好~/.vimrc这个文件,就可以通过命令管理其他Vim插件了,非常好用。下面我们就介绍如何使用它吧!(以下都是在Linux系统内操作)
如何安装:
Step1: 直接用git,将Vundle下载下来。
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Step2: 配置插件(Plugins)。 将下面的配置信息写到你的.vimrc文件中(一般情况下,我们vimrc的路径为"~/.vimrc",如果没有,就创建),然后保存。
set nocompatible " be iMproved, required
filetype off " required " set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call 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
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
Step3: 安装插件,打开vim,运行如下命令即可安装。
:PluginInstall
Step4: 查看安装状态
. Plugin 'VundleVim/Vundle.vim'
. Plugin 'tpope/vim-fugitive'
. Plugin 'rstacruz/sparkup'
+ Plugin 'tomasr/molokai'
+ Plugin 'scrooloose/nerdtree'
+ Plugin 'Lokaltog/vim-powerline'
+ Plugin 'bling/vim-airline'
+ Plugin 'SublimeText/CTags'
+ Plugin 'Valloric/YouCompleteMe'
+ Plugin 'majutsushi/tagbar'
执行完Step3的命令后,会显示上面的安装进度,下面是如何读懂安装进度的说明。
'.'代表已经此前安装过的插件。
'+'代表本次安装的插件。
确认安装完成后,用命令":q"退出即可。
Step5: 添加/删除插件。
下面介绍几个好用的插件:
Plugin 'tomasr/molokai' 好用的配色
Plugin 'scrooloose/nerdtree' 方便文件管理
Plugin 'Lokaltog/vim-powerline' 下方的状态
Plugin 'bling/vim-airline' 好看的配色
Plugin 'SublimeText/CTags' 有tags方便补全
Plugin 'Valloric/YouCompleteMe' 功能强大的补全
Plugin 'majutsushi/tagbar' 显示变量和函数名
比如我们想添加 'tomasr/molokai'这个插件,只需要把 Plugin 'tomasr/molokai'添加到.vimrc中有关Plugin插件的那一段中,然后执行:PluginInstall命令安装就好。
如果想删除插件,同理。
参考链接:
如何在Linux上使用vundle管理vim插件 https://linux.cn/article-9416-1.html
最新文章
- android应用开发(十):widget的使用
- php 获取远程图片保存到本地
- OpenCV播放视频带滚动条(3)
- A required class was missing while executing org.apache.maven.plugins:maven-war-plugin:2.1.1:war
- Windows 10四大版本区别详解:家庭版, 专业版, 企业版和教育版
- JQuery上传文件插件Uploadify使用笔记
- [ZZ] HDR the bungie way
- 理解CSS3里的Flex布局用法
- hdu 5563 Clarke and five-pointed star 水题
- iOS 图片背景模糊效果
- 创建用于自定义SharePoint解决方案部署的Visual Studio项目
- 正整数从1到N,输出按照字典序排序的前K个数
- 在ASP.NET MVC 中获取当前URL、controller、action 、参数
- 【redis源码阅读】redis对象
- ansible之一:安装与配置
- Java安装以及环境变量配置
- 变量类型-Number
- sql server导出数据,详细操作!(自用)
- 使用IdentityServer4实现一个简单的Oauth2客户端模式授权
- Android 实时录音和回放,边录音边播放 (KTV回音效果)