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…
search string in whole project , list matching lines in quickfix window:
:vim foo **/*.py | cw
record change in simple macro:
qq ciwbar<esc> :cnext<cr> q
repeat change every match in list:
@q @@ @@ …
skipping irrelevant matches
:cnext
.
and one…
open new tab:
:tabnew<cr>
populate local argument list files contain search pattern:
:arglocal `grep -rl foo *.js`<cr>
perform global search/replace on every file in local argument list
:argdo %s/foo/bar/gc<cr> yyyynnnyyy…
Comments
Post a Comment