下载color插件
https://www.vim.org/scripts/script.php?script_id=3412
设置vimrc配置文件
cat ~/.vimrc
set nu
syntax enable
syntax on
set background=dark
nmap fc :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap fd :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap fe :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap ff :cs find f <C-R>=expand("<cword>")<CR><CR>
nmap fg :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap fi :cs find i <C-R>=expand("<cword>")<CR><CR>
nmap fs :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap ft :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <c-]> :cs find s <C-R>=expand("<cword>")<CR><CR>
"按F9即可打开tagbar界面
nmap <silent> <F9> :TagbarToggle<CR>
let g:tagbar_ctags_bin = 'ctags' "tagbar以来ctags插件
let g:tagbar_left = 1 "让tagbar在页面左侧显示,默认右边
let g:tagbar_width = 20 "设置tagbar的宽度为30列,默认40
let g:tagbar_autofocus = 1 "这是tagbar一打开,光标即在tagbar页面内,默认在vim打开的文件内
let g:tagbar_sort = 0 "设置标签不排序,默认排序
"nmap <c-/> :<c-s-w><c-s><c-s-w><CR>
"filetype plugin on
"let g:C_UseTool_cmake = 'yes'
"let g:C_UseTool_doxygen = 'yes'
"colorscheme desert
colorscheme default
hi Search ctermfg=0 ctermbg=3
hi Linenr ctermfg=0 ctermfg=3
hi Statement ctermfg=0 ctermfg=3
-bash-4.2$ cat ~/.vim/syntax/c.vim
"highlight Functions
syn match cFunctions display "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match cFunctions display "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi cFunctions ctermfg=175 cterm=bold guifg=goldenrod
"========================================================
"" Highlight All Math Operator
"========================================================
"" C math operators
"syn match cMathOperator display "[-+/*/%=<>{};|.\[\],&!^:]"
syn match cMathOperator display "[-+/*/%=]"
"" C pointer operators
syn match cPointerOperator display "->/|/."
"" C logical operators - boolean results
syn match cLogicalOperator display "[!<>]=/="
syn match cLogicalOperator display "==/|/<=/|/>=/|/!="
"" C bit operators
syn match cBinaryOperator display "/(&/||/|/^/|<</|>>/)=/="
"syn match cBinaryOperator display "/~"
"syn match cBinaryOperatorError display "/~="
"" More C logical operators - highlight in preference to binary
syn match cLogicalOperator display "&&/|||"
syn match cLogicalOperatorError display "/(&&/|||/)="
" for yuchen
syn match cfenhao display ";"
syn match ckuohao display "("
syn match ckuohao display ")"
syn match ckuohao display ","
syn match ckuohao display "{"
hi cfenhao ctermbg=0 ctermfg=128
hi ckuohao ctermbg=0 ctermfg=128
" Math Operator
hi cMathOperator guifg=#3EFFE2 ctermfg=6
hi cPointerOperator guifg=#3EFFE2 ctermfg=40
hi cLogicalOperator guifg=#3EFFE2
hi cBinaryOperator guifg=#3EFFE2
hi cBinaryOperatorError guifg=#3EFFE2
hi cLogicalOperator guifg=#3EFFE2
hi cLogicalOperatorError guifg=#3EFFE2
hi def link cFunction Function
hi Identifier ctermfg=0 ctermfg=3
hi Statement ctermfg=0 ctermfg=3
hi Comment ctermfg=0 ctermfg=12
色彩插件:
http://github.com/guns/xterm-color-table.vim