Clang-Rename

clang-rename is a C++ refactoring tool. Its purpose is to perform
efficient renaming actions in large-scale projects such as renaming classes,
functions, variables, arguments, namespaces etc.

The tool is in a very early development stage, so you might encounter bugs and
crashes. Submitting reports with information about how to reproduce the issue
to the LLVM bugtracker will definitely help the
project. If you have any ideas or suggestions, you might want to put a feature
request there.

clang-rename is a LibTooling-based tool, and it’s easier to
work with if you set up a compile command database for your project (for an
example of how to do this see How To Setup Tooling For LLVM). You can also
specify compilation options on the command line after –:

The tool currently supports renaming actions inside a single translation unit
only. It is planned to extend the tool’s functionality to support multi-TU
renaming actions in the future.

clang-rename also aims to be easily integrated into popular text
editors, such as Vim and Emacs, and improve the workflow of users.

Although a command line interface exists, it is highly recommended to use the
text editor interface instead for better experience.

You can also identify one or more symbols to be renamed by giving the fully
qualified name:

$ clang-rename -qualified-name=foo -new-name=bar test.cpp

Renaming multiple symbols at once is supported, too. However,
clang-rename doesn’t accept both -offset and -qualified-name at
the same time. So, you can either specify multiple -offset or
-qualified-name.

Please note that you have to save all buffers, in which the replacement will
happen before running the tool.

Once installed, you can point your cursor to symbols you want to rename, press
<leader>cr and type new desired name. The <leader> key
is a reference to a specific key defined by the mapleader variable and is bound
to backslash by default.