1、vim插件管理器——Vundle(详细介绍见:~/.vim/bundle/vundle/doc/vundle.txt)
(1)Vundle安装
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
(2)Vundle配置
Vundle的配置在~/.vimrc中,说明见下面的配置。
(3)Vundle使用
插件安装:
:BundleInstall
插件更新:
:BundleInstall!
插件检索:
:BundleSearch foo
列出所有已安装插件:
:BundleList
插件卸载
:BundleClean
2. ~/.vimrc配置备份
"====================================
" FileName: ~/.vimrc
" Author:
" Version:
" Email:
" Date:
"=============================================
"=============================================
" Plugins Configuration
"=============================================
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github (位于github上其他repo上的插件)
" vim-scripts repos (位于vim-scripts repo上的插件)
Bundle 'a.vim'
Bundle 'taglist.vim'
"Bundle 'c.vim'
Bundle 'mattn/emmet-vim'
Bundle 'ervandew/supertab'
Bundle 'davidhalter/jedi-vim'
" non github repos (非github的repo上的插件)
" git repos on your local machine (ie. when working on your own plugin) (位于本地的插件)
" ...
"
filetype plugin indent on " required!
" or
" filetype plugin on " to not use the indentation settings set by plugins
let g:user_emmet_install_global = 0 " mattn/emmet-vim used(other settings refer to github of emmet-vim)
autocmd FileType html,css EmmetInstall " mattn/emmet-vim used(other settings refer to github of emmet-vim)
"==================================
" Vim基本配置
"===================================
" 显示行号
set nu
" 设置匹配模式,例如当选中左括号时,会自动定位右括号的位置
set showmatch
" 设置Tab键的宽度,以空格为单位
set tabstop=4
" 设置自动缩进的宽度,以空格为单位
set smartindent
set shiftwidth=4
set softtabstop=4
" 将Tab键自动转换成空格 真正需要Tab键时使用[Ctrl + V + Tab]
"set ts=4
"set expandtab
" 设置编码
let &termencoding=&encoding
set fileencodings=utf-8,gbk,big5
" 查找时高亮
" set hls
" 增加鼠标支持
"set mouse=a
" 切换粘贴模式,为了防止从外部复制的内容在vim中粘贴时,出现的每行都会缩进的现象。使用方法:Start insert mode → Press F2 (toggles the 'paste'
option on) → Use your terminal to paste text from the clipboard → Press F2 (toggles the 'paste'
option off)
set pastetoggle=<F2>