[clang-tools-extra] r276870 - change Vim key binding for include-fixer and clang-rename

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 07:23:47 PDT 2016


Author: omtcyfz
Date: Wed Jul 27 09:23:47 2016
New Revision: 276870

URL: http://llvm.org/viewvc/llvm-project?rev=276870&view=rev
Log:
change Vim key binding for include-fixer and clang-rename

Change Vim key binding for include-fixer (`,cf` -> `<leader>cf`) and
clang-rename (`,cr` -> `<leader>cr`) to use `<leader>` instead of `,` like
cool Vim people (tm) do.

Reviewers: ioeric

Differential Revision: https://reviews.llvm.org/D22854


Modified:
    clang-tools-extra/trunk/clang-rename/tool/clang-rename.py
    clang-tools-extra/trunk/docs/clang-rename.rst
    clang-tools-extra/trunk/docs/include-fixer.rst
    clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py

Modified: clang-tools-extra/trunk/clang-rename/tool/clang-rename.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/tool/clang-rename.py?rev=276870&r1=276869&r2=276870&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-rename/tool/clang-rename.py (original)
+++ clang-tools-extra/trunk/clang-rename/tool/clang-rename.py Wed Jul 27 09:23:47 2016
@@ -9,13 +9,13 @@ Before installing make sure one of the f
 
 To install, simply put this into your ~/.vimrc
 
-    map ,cr :pyf <path-to>/clang-rename.py<cr>
+    noremap <leader>cr :pyf <path-to>/clang-rename.py<cr>
 
 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 '<leader>cr'. You will be prompted for a new
+name if the cursor points to a valid symbol.
 '''
 
 import vim

Modified: clang-tools-extra/trunk/docs/clang-rename.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-rename.rst?rev=276870&r1=276869&r2=276870&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-rename.rst (original)
+++ clang-tools-extra/trunk/docs/clang-rename.rst Wed Jul 27 09:23:47 2016
@@ -92,8 +92,11 @@ You can call :program:`clang-rename` dir
 `clang-rename/tool/clang-rename.py
 <http://reviews.llvm.org/diffusion/L/browse/clang-tools-extra/trunk/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
+``<leader>cr`` and print new desired name. The
+[``<leader> 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.

Modified: clang-tools-extra/trunk/docs/include-fixer.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/include-fixer.rst?rev=276870&r1=276869&r2=276870&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/include-fixer.rst (original)
+++ clang-tools-extra/trunk/docs/include-fixer.rst Wed Jul 27 09:23:47 2016
@@ -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<cr>
+  noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py<cr>
 
-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
+``<leader>cf`` to another binding if you need clang-include-fixer on a different
+key. The
+[``<leader> 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`:
 

Modified: clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py?rev=276870&r1=276869&r2=276870&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py (original)
+++ clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py Wed Jul 27 09:23:47 2016
@@ -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<cr>
+#   noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py<cr>
 #
-# 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 "<leader>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
 #




More information about the cfe-commits mailing list