From 74c21ad4e4833869f286fb72df0cbbdcfc9a054b Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 8 Jan 2010 14:49:27 +0100 Subject: [Vim] cleanup, and replaced by /home/hugues for ctags --- vimrc | 85 ++++++++++++++++++++++++++++++------------------------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/vimrc b/vimrc index f901c50..513b739 100644 --- a/vimrc +++ b/vimrc @@ -34,16 +34,11 @@ set mousehide " highlighting strings inside C comments let c_comment_strings=1 - + " Backup dir set autowrite -" compilation macros -map :Domake -map \ :cl -imap :cNi -imap :cni -" set default error format +" default error format "set efm=\"%f\"\\,\ line\ %l:\ error\ %m,\"%f\"\\,\ line\ %l:\ warning\ %m " remaps C-j & C-k to C-y and C-e @@ -51,38 +46,33 @@ noremap noremap "Macros -map :source ~/.vim/bépo -"map :Printcheader -"map :Printfheader -"map :Printhheader -map ^i/* $a */ -map ^./\/\* 3x^./ \*\/3x - -" folding +map :source ~/.vim/bépo + +" folding map :SwitchFoldState map zA "buffer moving -map :bN +map :bN " Load local cscope db if exists if filereadable( expand("$PWD/tags") ) - set tags=tags -elseif filereadable( expand("$ROOT/ctags.out") ) - set tags=$ROOT/ctags.out + set tags=tags +elseif filereadable( expand("$PWD/ctags.out") ) + set tags=$pwd/ctags.out elseif has("cscope") - if filereadable( expand("$ROOT/cscope.out") ) - set cst - " cscope macros - map :cs find g =expand("") " find global definition - map :cs find c =expand("") " find callers of function under cursor - map :cs find t =expand("") " find assignments to variable under cursor - map :cs find s =expand("") " find string under cursor - map :cs find f =expand("") " find file under cursor - map :cs find i =expand("") " find files including file under cursor - map :cs find I % " find files including current file - cs add $ROOT/cscope.out $ROOT - endif + if filereadable( expand("$PWD/cscope.out") ) + set cst + " cscope macros + map :cs find g =expand("") " find global definition + map :cs find c =expand("") " find callers of function under cursor + map :cs find t =expand("") " find assignments to variable under cursor + map :cs find s =expand("") " find string under cursor + map :cs find f =expand("") " find file under cursor + map :cs find i =expand("") " find files including file under cursor + map :cs find I % " find files including current file + cs add $PWD/cscope.out + endif endif " F*cking trailing whitespaces @@ -95,9 +85,10 @@ set diffopt=iwhite,filler set guifont=LucidaTypewriter\ 8 " mouse -" v -> enabled in visual mode -" i -> enabled in insert mode -" c -> enabled in command mode +" v -> enabled in visual mode +" i -> enabled in insert mode +" c -> enabled in command mode +" a -> enabled in all modes set mouse=a set mousem=extend @@ -113,17 +104,17 @@ map u :noh " Function -" Erase_Sig_but_Your() +" Erase_Sig_but_Your() " " Author -" Yann Kerhervé -" Based on Luc Hermitte work +" Yann Kerhervé +" Based on Luc Hermitte work " " Purpose -" Deletes signatures at the end of e-mail replies. But keep -" your sig intact (mutt-added). -" Also deletes the empty lines (even those beginning by '>') -" preceding the signature. +" Deletes signatures at the end of e-mail replies. But keep +" your sig intact (mutt-added). +" Also deletes the empty lines (even those beginning by '>') +" preceding the signature. " function! Erase_Sig_but_Your() " Search for the signature pattern : "^> -- $" @@ -162,12 +153,12 @@ function! Erase_Sig_but_Your() endfunction function! GitBlameCurrentLine() - let l:line = line('.') - let l:file = expand("%:t") - let l:wd = expand("%:p:h") - let content = system("cd " . l:wd . ";git blame -L ". l:line . "," . l:line . " " . l:file . " | sed 's/).*/)/'") - let line = split(content, '\n')[0] - echohl Type | echo line | echohl None + let l:line = line('.') + let l:file = expand("%:t") + let l:wd = expand("%:p:h") + let content = system("cd " . l:wd . ";git blame -L ". l:line . "," . l:line . " " . l:file . " | sed 's/).*/)/'") + let line = split(content, '\n')[0] + echohl Type | echo line | echohl None endfunction command! GitBlameCurrentLine :call GitBlameCurrentLine() map b :GitBlameCurrentLine -- cgit v1.2.3