個人vim配置文件.vimrclinux
map <silent> <F10> :TlistToggle<cr>
map <silent> <F8> :TMiniBufExplorer<cr>
map <silent> <F9> :WMToggle<cr>
map <silent> <F4> :bp<cr>
map <silent> <F5> :bn<cr>
"map <C-f> :q<cr>
"map <C-i> :w<cr>
"map <C-a> :x<cr>
nnoremap <silent> <F12> :A<CR>
nnoremap <silent> <F3> :Grep<CR>
"taglist
let g:Tlist_Show_One_File=1
let g:Tlist_Exit_OnlyWindow=1
"let g:Tlist_File_Fold_Auto_Close=1vim
let g:AutoOpenWinManager = 1
let g:winManagerWindowLayout='FileExplorer|TagList'
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:SuperTabDefaultCompletionType="context"
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"
let g:bufExplorerMaxHeight=30windows
let OmniCpp_MayCompleteDot = 1 " 輸入 . 後自動補全
let OmniCpp_MayCompleteArrow = 1 " 輸入 -> 後自動補全
let OmniCpp_MayCompleteScope = 1 字體
"let g:miniBufExplorerMoreThanOne=0ui
let g:winManagerWidth = 25
set nocp
filetype plugin on
set completeopt=longest,menu
syntax enable
syntax on
colorscheme default
"colorscheme desert
set cscopequickfix=s-,c-,d-,i-,t-,e-編碼
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"cscope快捷方式spa
set mouse=a "設置能夠鼠標操做
set nu
set tabstop=4 "設置製表符寬度爲4
set softtabstop=4 "設置(軟)製表符寬度爲4
set shiftwidth=4 "設置縮進的空格數爲4
set autoindent "設置自動縮進:即每行的縮進值與上一行相等;使用 noautoindent 取消設置
set cindent "設置 使用 C/C++ 語言的自動縮進方式
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s "設置C/C++語言的具體縮進方式(以個人windows風格爲例)
let &termencoding=&encoding
set fileencodings=utf-8,gbk,cp936,big5,ucs-bom "設置語言編碼支持orm
"set tags=./tags,~/.vim/tags/linux/ctags/tags,../deps/libzs/tags "設置tags文件路徑ip
set fdm=syntax "設置摺疊方式
set foldcolumn=0 " 設置摺疊區域的寬度
"set foldclose=all " 設置爲自動關閉摺疊
setlocal foldlevel=1 " 設置摺疊層數爲
set foldlevelstart=99 "打開文件默認不折疊
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zC' : 'zO')<CR>
"用空格鍵來開關摺疊utf-8
hi Comment ctermfg =darkcyan
"設置註釋字體顏色
set clipboard+=unnamed
" 與windows共享剪貼板
hi Folded guibg=black guifg=grey40 ctermfg=grey ctermbg=darkgrey
hi FoldColumn guibg=black guifg=grey20 ctermfg=4 ctermbg=7
"設置摺疊顏色
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"vim打開時在上次光標的位置
set wildmenu
"命令窗口列表
"Smart way to move btw. window
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
"F11生成/更新tags文件 set tags=tags; set autochdir function! UpdateTagsFile() silent !ctags -R --fields=+ianS --extra=+q endfunction nmap <F11> :call UpdateTagsFile()<CR> "Ctrl + F12刪除tags文件 function! DeleteTagsFile() "Linux下的刪除方法 silent !rm tags "Windows下的刪除方法 silent !del /F /Q tags endfunction nmap <C-F11> :call DeleteTagsFile()<CR> "退出VIM以前刪除tags文件 "au VimLeavePre * call DeleteTagsFile()