c - How to go all reference of a text in whole project using vim -


i know simple question , there huge source of information not able find solution question.

i have tried cscope , got references once in file not find way go go next occurrence.

i know use of ctrl+] ctags not want.i want go reference of text 1 one .

like when want change prototype of function , want go 1 one.

hope there way it.

you looking :tnext , :tprevious.

read following topics:

:help tags :help ctags :help cscope 

but here generic "search/replace in project" method…

  1. search string in whole project , list matching lines in quickfix window:

    :vim foo **/*.py | cw 
  2. record change in simple macro:

    qq ciwbar<esc> :cnext<cr> q 
  3. repeat change every match in list:

    @q @@ @@ … 

    skipping irrelevant matches :cnext.

and one…

  1. open new tab:

    :tabnew<cr> 
  2. populate local argument list files contain search pattern:

    :arglocal `grep -rl foo *.js`<cr> 
  3. perform global search/replace on every file in local argument list

    :argdo %s/foo/bar/gc<cr> yyyynnnyyy… 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -