重玩 vim 之琐碎记录——插件管理程序

根据我以往的经验,先搞定一个基本的 vimrc,然后再安装一个插件管理,就能很轻松完成 vim 配置了。所以 google,看过一个知乎用户的回答,懒惰的我选择了以前就用过的 vundle。

小插曲

其实由于我借用的那个 vimrc 的作者用的 插件管理工具是 pathogen,所以我一开始也就安装了 pathogen,而后才搜到这个回答,于是乎,需要先卸载 pathogen,再次 google,卸载方法如下:

delete ~/.vim/autoload/pathogen.vim
delete the lines you have added to ~/.vimrc

安装 Vundle

Vundle 需要用到 Git 和 Curl,所以安装前请确保这两个都已经安装。

installation requires Git and triggers git clone for each configured repository to ~/.vim/bundle/ by default. Curl is required for search.
If you are using Windows, go directly to Windows setup.

在终端运行这行代码

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

然后把下面的配置粘贴进 .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'


" 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

ok,打开 vim,可以安装插件了,操作如下:

启动 vim,运行 :PluginInstall

你可能感兴趣的:(vim)