我的vim插件与配置文件
记录一下我的vim的插件及.vimrc的配置
1.ctags:
使用命令ctags -R
2.cscope:
使用命令
find `pwd` -name "*.[chs]" > cscope.files
cscope -Rbkq
3.Toglist
4.winmanager
5.pathogen:
管理插件
6.nerdtree
7.clang_complete
8.clang
附:
我的.vimrc
"
"my vim configuration
"
" 设置字体
set guifont=DejaVu\ Sans\ Mono\ 10
" 关闭compatible
set nocompatible
" 开启语法高亮
syntax on
" 设置文字编码自动识别
set fencs=gbk,utf-8,ucs-bom,gb18030,gb2312,cp936
" 使用鼠标
set mouse=a
" 设置高亮搜索
set hlsearch
" 输入字符串就显示匹配点
set incsearch
" 输入的命令显示出来,看的清楚些。
set showcmd
set background=dark
set history=900 "历史记录900条
filetype plugin indent on "打开文件类型检测
set completeopt=longest,menu "关闭智能补全时的预览窗口
"颜色方案
colorscheme desert "desert颜色方案
"界面设置.
set ruler "显示当前位置
set number "显示行号
"set nonumber "不显示行号
"格式设置.
set autoindent "自动缩进
set smartindent "智能缩进
set cindent "C缩进
set tabstop=4 "硬TAB
set softtabstop=4 "软TAB
set shiftwidth=4 "缩进空格数
set expandtab "空格替换TAB
"set smarttab "智能TAB
set tags=tags; "ctags
set autochdir "ctags
" TagList"
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Left_Window = 1
" BufExplorer"
let g:bufExplorerDefaultHelp=0
let g:bufExplorerShowRelativePath=1
let g:bufExplorerSortBy='mru'
let g:bufExplorerSplitRight=0
let g:bufExplorerSplitVertical=1
let g:bufExplorerSplitVertSize = 30
autocmd BufWinEnter /[Buf/ List/] setl nonumber
"MiniBufExplore"
"let g:SuperTabDefaultCompletionType = "context"
" winManager setting"
let g:winManagerWindowLayout = "FileExplorer,BufExplorer|TagList"
"let g:winManagerWindowLayout = 'NERDTree|TagList,BufExplorer'
let g:winManagerWidth = 30
let g:defaultExplorer = 0
map <span style="color: #00FF00;"><f12></span> :WMToggle<cr>
imap <span style="color: #00FF00;"><f12></span> <esc><f12>a
nmap <C-W><C-F> :FirstExplorerWindow<cr>
nmap <C-W><C-B> :BottomExplorerWindow<cr>
nmap <silent> <leader>wm :WMToggle<cr>
nmap <silent> <leader>wu :wa<cr>:TlistUpdate<cr>:FirstExplorerWindow<cr>
" lookupfile setting"
let g:LookupFile_MinPatLength = 2
let g:LookupFile_PreserveLastPattern = 0
let g:LookupFile_PreservePatternHistory = 1
let g:LookupFile_AlwaysAcceptFirst = 1
let g:LookupFile_AllowNewFiles = 0
if filereadable("./filenametags")
let g:LookupFile_TagExpr = '"./filenametags"'
endif
nmap <silent> <leader>lk :LUTags<cr>
nmap <silent> <leader>ll :LUBufs<cr>
nmap <silent> <leader>lw :LUWalk<cr>
" cscope setting"
"set cscopequickfix=s-,c-,d-,i-,t-,e-
if has("cscope")
set csprg=/usr/bin/cscope
set csto=1
set cst
set nocsverb
"add my database in current directory
if filereadable("cscope.out")
cs add cscope.out
endif
set csverb
endif
set clipboard+=unnamed
nmap <F6>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <F6>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <F6>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <F6>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <F6>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <F6>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <F6>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <F6>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" 代码折叠
set foldmethod=syntax
set foldlevel=100 " 启动 vim 时不要自动折叠代码
" superTab
"let g:SuperTabRetainCompletionType=2
"let g:SuperTabDefaultCompletionType="<C-X><C-O>"
" ctags_highlighting
let b:TypesFileRecurse = 1
let b:TypesFileDoNotGenerateTags = 1
let b:TypesFileIncludeLocals = 1
"let b:TypesFileIncludeSynMatches =1
"let b:TypesFileLanguages = ['c']
" Fn 快捷键
" F5 - LookUpFile, F6 - cscope
nnoremap <silent> <F7> :WMToggle<CR> “(注意冒号前面需要有个空格奥)
nnoremap <silent> <F8> :A<CR>
set nocompatible
"pathogen
"call pathogen#infect()
"call pathogen#helptags()
" 设置NerdTree
map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>
"python
"set filetype=python
"au BufNewFile,BufRead *.py,*.pyw setf python
"clang
let g:clang_complete_copen=1
let g:clang_periodic_quickfix=1
let g:clang_snippets=1
let g:clang_close_preview=1
let g:clang_use_library=1
let g:clang_user_options='-stdlib=libc++ -std=c++11 -IIncludePath'
let g:neocomplcache_enable_at_startup = 1