[PATCH] D22854: change Vim key binding for include-fixer and clang-rename

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 05:01:21 PDT 2016


omtcyfz created this revision.
omtcyfz added reviewers: alexfh, klimek, ioeric.
omtcyfz added a subscriber: cfe-commits.

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.

https://reviews.llvm.org/D22854

Files:
  clang-rename/tool/clang-rename.py
  docs/clang-rename.rst
  docs/include-fixer.rst
  include-fixer/tool/clang-include-fixer.py

Index: include-fixer/tool/clang-include-fixer.py
===================================================================
--- include-fixer/tool/clang-include-fixer.py
+++ 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<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
 #
Index: docs/include-fixer.rst
===================================================================
--- docs/include-fixer.rst
+++ docs/include-fixer.rst
@@ -60,10 +60,11 @@
 
 .. 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.
 
 Make sure vim can find :program:`clang-include-fixer`:
 
Index: docs/clang-rename.rst
===================================================================
--- docs/clang-rename.rst
+++ docs/clang-rename.rst
@@ -93,7 +93,7 @@
 <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.
+press `<leader>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**.
Index: clang-rename/tool/clang-rename.py
===================================================================
--- clang-rename/tool/clang-rename.py
+++ clang-rename/tool/clang-rename.py
@@ -9,13 +9,13 @@
 
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22854.65708.patch
Type: text/x-patch
Size: 3101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160727/e2720147/attachment-0001.bin>


More information about the cfe-commits mailing list