From: Pierre Habouzit Date: Thu, 15 Sep 2011 19:36:44 +0000 (+0200) Subject: vim updates X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=755c8eadfb8b252af437c0c44b4270a289cb4d0b;p=~madcoder%2Fdotfiles.git vim updates Signed-off-by: Pierre Habouzit --- diff --git a/vim/filetype.vim b/vim/filetype.vim index cb25802..c0f12d2 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -10,6 +10,7 @@ augroup filetypedetect au BufRead,BufNewFile *.tpl setf xhtml au BufRead,BufNewFile *.blk setf c + au BufRead,BufNewFile *.blkk setf cpp au BufRead,BufNewFile massif.*.txt setf massif diff --git a/vim/ftplugin/gitcommit.vim b/vim/ftplugin/gitcommit.vim index 2df4af7..a0c8f54 100644 --- a/vim/ftplugin/gitcommit.vim +++ b/vim/ftplugin/gitcommit.vim @@ -67,4 +67,10 @@ if exists("g:git_diff_spawn_mode") endif endif +ab cc: Cc-Redmine: yes +ab v: Version: +ab sob: Signed-off-by: +ab ack: Acked-by: +ab r: Reviewed-by: + " }}} diff --git a/vim/syntax/c.vim b/vim/syntax/c.vim index 81c24f8..41ac4ad 100644 --- a/vim/syntax/c.vim +++ b/vim/syntax/c.vim @@ -9,8 +9,8 @@ syn match isGlobal "\<[a-zA-Z_][a-zA-Z0-9_]*_g\>" syn keyword cType byte syn match cFunction "\<\([a-z][a-zA-Z0-9_]*\|[a-zA-Z_][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)\> *("me=e-1 -syn match Function "\$\<\([a-z][a-zA-Z0-9_]*\|[a-zA-Z_][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)\> *[({]"me=e-1 -syn match cType "\<[a-zA-Z_][a-zA-Z0-9_]*_[ft]\>" +syn match cPreProc "[$@]\<\([a-z][a-zA-Z0-9_]*\|[a-zA-Z_][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)\>" +syn match cType "\<[a-zA-Z_][a-zA-Z0-9_]*_[bft]\>" hi def link isGlobal Function hi def link cStructure Type diff --git a/vimrc b/vimrc index 23e3632..7127c78 100644 --- a/vimrc +++ b/vimrc @@ -53,11 +53,15 @@ set softtabstop=4 " sts set expandtab " expand tabs set notextmode " no - I am using Vim on UNIX! set textwidth=0 " Don't wrap words by default +set cc=+1 set title " Permet de voir le tit. du doc. crt. ds les XTERM set viminfo='1000,/1000,:1000,<1000,@1000,n~/.viminfo set history=1000 " What info to store from an editing session " in the viminfo file; can be used at next session. +set undofile +set undodir=~/.cache/vim/ +au BufWritePre /tmp/* setlocal noundofile set sessionoptions=buffers,folds,localoptions,options,tabpages,help set ignorecase " Do case insensitive matching @@ -88,19 +92,20 @@ set complete-=k complete+=k set tags=tags;/,.tags;/,TAGS;/ set cinoptions= +set cinoptions+=L0.5s " align labels at 0.5 shiftwidth +set cinoptions+=:0.5s,=0.5s " same for case labels and code following a label +set cinoptions+=g0.5s,h0.5s " same for c++ stuff set cinoptions+=t0 " type on the line before the functions is not idented -set cinoptions+=:2,=2 " indent case ...: of 2 from the switch { set cinoptions+=(0,Ws " indent in functions ( ... ) when it breaks -set cinoptions+=g2,h2 " indent C++ scope of 2, and the members from 2 from it set cinoptions+=m1 " aligh the closing ) properly -"set cinoptions+=l1 " align closing brace with the case -"set cinoptions+=b1 " align break; with case ...: +set cinoptions+=j1 " java/javscript -> fixes blocks +"set cinoptions+=l0.5s " align code after label ignoring braces. set diffopt=filler,context:5,iwhite set fillchars+=diff:\ ,vert:│ set makeprg=LC_ALL=C\ make\ MONOCHROME=1 -set grepprg=egrep\ -n\ $*\ /dev/null +set grepprg=egrep\ --exclude='*.blk.c'\ --exclude='*.blkk.cc'\ -n\ $*\ /dev/null exe "set path=." . system("echo | cpp -v 2>&1 | grep '^ .*/include' | tr -d \"\n\" | tr \" \" \",\"") set path+=.;/ @@ -180,10 +185,10 @@ inoremap =TabAlign() " }}} -map + :cn -map - :cp -map :cn -map :cp +map + :cnext +map - :cprevious +map :cnext +map :cprevious map Q gq @@ -195,10 +200,6 @@ inoremap mzviwU`z noremap :set ai!:set ai? inoremap a -noremap :bp -inoremap :bp -noremap :bn -inoremap :bn noremap :make!:bo cw 8 inoremap :make!:bo cw 8 noremap :make clean @@ -211,6 +212,8 @@ if has("autocmd") filetype plugin indent on syntax on + au Syntax {cpp,c,javascript} runtime syntax/doxygen.vim + au BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | @@ -364,6 +367,7 @@ if has("gui_running") || &t_Co >= 88 exec myhi("Normal", "none", "dfdfdf", "NONE") exec myhi("MoreMsg", "none", "dfdfdf", "NONE") endif + exec myhi("ColorColumn", "none", "NONE", "0f0f0f") exec myhi("Comment", "none", "afafff", "0f0f0f") exec myhi("Folded", "none", "afafff", "0f0f0f") @@ -424,6 +428,22 @@ if has("gui_running") || &t_Co >= 88 " C exec myhi("cFunction", "none", "b0b0b0", "NONE") + + " Doxygen + if !exists(':SynLink') + command -nargs=+ SynLink hi def link + endif + SynLink doxygenSpecialTypeOnelineDesc doxygenBrief + SynLink doxygenSpecialOnelineDesc doxygenBrief + SynLink doxygenSpecialHeading doxygenBrief + SynLink doxygenParamDirection doxygenSpecial + + exec myhi("doxygenComment", "none", "6060ff", "0f0f0f") + exec myhi("doxygenBrief", "none", "6060ff", "0f0f0f") + exec myhi("doxygenPrev", "none", "6060ff", "0f0f0f") + exec myhi("doxygenParam", "none", "6060ff", "0f0f0f") + exec myhi("doxygenSpecial", "none", "6060ff", "0f0f0f") + exec myhi("doxygenParamName", "underline", "6060ff", "0f0f0f") else hi Comment cterm=none ctermfg=blue ctermbg=none hi Folded cterm=none ctermfg=brown ctermbg=none