How to find all occurrences of a variable in Vim? -
in vim, how find occurrences of variable in files under directory?
i know vimgrep works sometimes, looks text , doesn't work if other classes have variables of same name , want variable under specific class.
what should do? or should ide instead?
why want use ide when have one? vim is ide configurable , usable different languages..
you use cscope
build database of code. database
- allows searching code for:
- all references symbol
- global definitions
- functions called function
- functions calling function
- text string
- regular expression pattern
- a file
- files including file
further features of cscope:
- curses based (text screen)
- an information database generated faster searches , later reference
- the fuzzy parser supports c, flexible enough useful c++ , java, , use generalized 'grep database' (use browse large text documents!)
- has command line mode inclusion in scripts or backend gui/frontend
- runs on flavors of unix, plus monopoly-controlled operating systems.
once database created, browse through usages of variables, functions, etc.
edit (slightly ot):
cool thing that's quite handy when working vim on code taglist plugin uses ctags:
the "tag list" plugin source code browser plugin vim , provides overview of structure of source code files , allows efficiently browse through source code files different programming languages.
Comments
Post a Comment