From c4018e2db67ba8a39c5ad8c0fc35c2283aaf79c3 Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Wed, 27 Jul 2016 14:23:47 +0000 Subject: change Vim key binding for include-fixer and clang-rename Change Vim key binding for include-fixer (`,cf` -> `cf`) and clang-rename (`,cr` -> `cr`) to use `` instead of `,` like cool Vim people (tm) do. Reviewers: ioeric Differential Revision: https://reviews.llvm.org/D22854 llvm-svn: 276870 --- clang-tools-extra/clang-rename/tool/clang-rename.py | 6 +++--- clang-tools-extra/docs/clang-rename.rst | 9 ++++++--- clang-tools-extra/docs/include-fixer.rst | 12 ++++++++---- clang-tools-extra/include-fixer/tool/clang-include-fixer.py | 6 +++--- 4 files changed, 20 insertions(+), 13 deletions(-) (limited to 'clang-tools-extra') diff --git a/clang-tools-extra/clang-rename/tool/clang-rename.py b/clang-tools-extra/clang-rename/tool/clang-rename.py index 1c9082d99b0..20530c3db1f 100644 --- a/clang-tools-extra/clang-rename/tool/clang-rename.py +++ b/clang-tools-extra/clang-rename/tool/clang-rename.py @@ -9,13 +9,13 @@ Before installing make sure one of the following is satisfied: To install, simply put this into your ~/.vimrc - map ,cr :pyf /clang-rename.py + noremap cr :pyf /clang-rename.py IMPORTANT NOTE: Before running the tool, make sure you saved the file. All you have to do now is to place a cursor on a variable/function/class which -you would like to rename and press ',cr'. You will be prompted for a new name if -the cursor points to a valid symbol. +you would like to rename and press 'cr'. You will be prompted for a new +name if the cursor points to a valid symbol. ''' import vim diff --git a/clang-tools-extra/docs/clang-rename.rst b/clang-tools-extra/docs/clang-rename.rst index 0b37669f632..4c02b6dbd51 100644 --- a/clang-tools-extra/docs/clang-rename.rst +++ b/clang-tools-extra/docs/clang-rename.rst @@ -92,8 +92,11 @@ You can call :program:`clang-rename` directly from Vim! To set up `clang-rename/tool/clang-rename.py `_. -Once installed, you can point your cursor to the symbols you want to rename, -press `,cr` and print new desired 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 +``cr`` and print new desired name. The +[`` key``](http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)#Map_leader) +is a reference to a specific key defined by the mapleader variable and is binded +to backslash by default. diff --git a/clang-tools-extra/docs/include-fixer.rst b/clang-tools-extra/docs/include-fixer.rst index 7bf6dc62982..015e734e740 100644 --- a/clang-tools-extra/docs/include-fixer.rst +++ b/clang-tools-extra/docs/include-fixer.rst @@ -64,10 +64,14 @@ following key binding to your ``.vimrc``: .. code-block:: console - map ,cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py - -This enables `clang-include-fixer` for NORMAL and VISUAL mode. Change ``,cf`` to -another binding if you need clang-include-fixer on a different key. + noremap cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py + +This enables `clang-include-fixer` for NORMAL and VISUAL mode. Change +``cf`` to another binding if you need clang-include-fixer on a different +key. The +[`` key``](http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)#Map_leader) +is a reference to a specific key defined by the mapleader variable and is binded +to backslash by default. Make sure vim can find :program:`clang-include-fixer`: diff --git a/clang-tools-extra/include-fixer/tool/clang-include-fixer.py b/clang-tools-extra/include-fixer/tool/clang-include-fixer.py index 66ff335678d..d09b55a5252 100644 --- a/clang-tools-extra/include-fixer/tool/clang-include-fixer.py +++ b/clang-tools-extra/include-fixer/tool/clang-include-fixer.py @@ -2,10 +2,10 @@ # - Change 'binary' if clang-include-fixer is not on the path (see below). # - Add to your .vimrc: # -# map ,cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py +# noremap cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py # -# This enables clang-include-fixer for NORMAL and VISUAL mode. Change ",cf" to -# another binding if you need clang-include-fixer on a different key. +# This enables clang-include-fixer for NORMAL and VISUAL mode. Change "cf" +# to another binding if you need clang-include-fixer on a different key. # # To set up clang-include-fixer, see http://clang.llvm.org/extra/include-fixer.html # -- cgit v1.2.1