Klocwork Refactoring in Vim
Klocwork Refactoring in VimThe C/C++ Klocwork Refactoring plug-in for Vim is part of the Command Line tools desktop analysis package. See Installing Klocwork for details on installing a desktop analysis plug-in. Note: These instructions assume that you have already set up a Klocwork project as described in Getting started with kwcheck for C/C++.
Note: The VIM refactoring plug-in no longer performs rename refactoring.
Installing the refactoring plug-in for VimNote: The C/C++ refactoring plug-in for Vim supports Vim 7.2 and later.
Copy the following file: <install path>Klocwork <Version> Command Line/plugins/kwrefactor.vim to one of the following locations:
where $HOME is the home directory being used by Vim. Note that you may need to create the \vimfiles\plugin directory under your Vim home directory. Tip: You can find your home directory with this Vim command:
:echo $HOME Setting up your environmentThe refactoring plug-in needs to know where the Klocwork Command Line tools are installed, as well as where the build specification is located. The build specification stores build settings for your project. The plug-in saves this information after each Vim session. If no build specification has been saved in a previous session, or the saved build specification is incorrect, then the refactoring plug-in will search:
If no build specification is found, the refactoring plug-in goes one directory up and continues from point 1.
Specifying the path to the Command Line tools installationUse the following command to manually specify the path to the Klocwork Command Line tools installation: :SetKwHome <command_line_tools_install>
Specifying the path to the build specificationUse the following command to manually specify the location of the Klocwork build specification: :SetKwSpec <build_specification_file> Using the refactoring plug-inJust start a new Vim session, place your cursor or select some code, and apply the appropriate refactoring. In Vim, use these hot-keys:
Tip: If you're lucky enough to be using gVim, try the right-click and Klocwork menus.
See Klocwork Refactoring for specific examples. |