vim配置
- 安装工具依赖ctags
sudo apt-get install ctags
- 安装插件管理工具vundle
https://github.com/VundleVim/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'
Plugin 'scrooloose/nerdtree'
Plugin 'taglist.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
" 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
"
" set Plugins
map <silent> <F3> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif "打开的文件除了NERDTree没有其他文件时,它自动关闭
"autocmd vimenter * NERDTree "打开vim时自动打开NERDTree
let NERDTreeWinPos="left"
"let NERDTreeWinPos='right'
"let g:NERDTreeWinSize=25
"let g:NERDTreeShowLineNumbers=1
"let g:neocomplcache_enable_at_startup = 1
map <silent> <F2> :TlistToggle<CR>
let Tlist_Ctags_Cmd='ctags'
let Tlist_Show_One_File=1 "不同时显示多个文件的tag,只显示当前文件的
"let Tlist_WinWidt =28 "设置taglist的宽度
let Tlist_Exit_OnlyWindow=1 "如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Use_Right_Window=1 "在右侧窗口中显示taglist窗口
"let Tlist_Use_Left_Windo =1 "在左侧窗口中显示taglist窗口
"
"设置配色
syntax enable
"set background=dark
if has('gui_running')
set background=light
else
set background=dark
endif
colorscheme solarized
- 添加配色solarized
https://github.com/altercation/vim-colors-solarized