On 2006-08-03, Tim Chase <[EMAIL PROTECTED]> wrote: > > * ctags variable name references - assuming I'm using ctags, how can > > I replace the name of a variable throughout my code base? > > Not sure on this one. One can add the files in question to the > argument/buffer list and then use > > :argdo %s/foo/bar/g > > or > > :bufdo %s/foo/bar/g > > to change "foo" to "bar" across the files in question. Others > may know more here.
ctags identifies where symbols are defined, not where they're used, so I don't see how ctags could be used for this. cscope, on the other hand, collects much more information about symbols and could be used for this task. It integrates very well with vim. Did you mean ctags or cscope? I never do a global change like this without looking at what I'm doing, i.e., changing each instance one at a time. I use either ":grep" or ":cscope find s" to generate a quickfix list of all instances of the symbol, then traverse the quickfix list, changing the symbols as I go. (Actually, I use the quickfix list and :cnf to go from file to file and normal searching within files to find the symbols since :grep and :cscope return only line numbers, not column numbers.) HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA