Vim configuration & usage memo

1. vim cstags&cscope auto load tags&db

For ctags, add following to .vimrc

set tags = tags;/

 Or using this

set tags=tags;
set autochdir

Note that, the semicolon(;) is necessary.

 For cscope, add following to .vimrc

function! LoadCscope()
  let db = findfile("cscope.out", ".;")
  if (!empty(db))
    let path = strpart(db, 0, match(db, "/cscope.out$"))
    set nocscopeverbose         " suppress 'duplicate connection' error
    exe "cs add " . db . " " . path
    set cscopeverbose
  endif
endfunction
au BufEnter /* call LoadCscope()

 2. vim mark usage

 

posted @ 2016-05-24 22:20  goingstudy  阅读(202)  评论(0编辑  收藏  举报