sponsor Vim development Vim logo Vim Book Ad

renamec.vim : Renaming refactoring for C symbols using cscope

 script karma  Rating 17/9, Downloaded by 1217  Comments, bugs, improvements  Vim wiki

created by
Bastian Mathes
 
script type
utility
 
description
I have not used or modified this script in a long time. Christophe-Marie Duquesne has published a script that is based on this script here, you will probably want to have a look at http://www.vim.org/scripts/script.php?script_id=3028

Original description:
A simple function to rename a C (and possibly C++) symbols (functions/variables) in multiple files using cscope information. Maybe just a starting point to adapt to your own needs, but at least works for me.

With the mapping below, one can start the renaming with \r, enter the new name and it will be renamed (using a simple substitution on the lines returned by cscope) in all files. Needs an up to date cscope reference file (see below).

 
install details
Put renamec.vim in your plugin directory. I use the following mapping
noremap <Leader>r :call Renamec()<cr>
to start the renaming with \r and
map <F12> :!cscope -R -k -b<CR>:cs reset<CR>
to update the cscope reference file.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
renamec.vim 0.1 2008-02-24 7.0 Bastian Mathes Initial upload
ip used for rating: 18.97.9.171

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github