[PATCH] D153338: [clang-format] vim integration: Mention python3 variant of bindings

Jannik Silvanus via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 23:44:27 PDT 2023


jsilvanus updated this revision to Diff 533149.
jsilvanus added a comment.

Don't change proposed key binding from K to I,
just add the python3 part.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153338/new/

https://reviews.llvm.org/D153338

Files:
  clang/docs/ClangFormat.rst


Index: clang/docs/ClangFormat.rst
===================================================================
--- clang/docs/ClangFormat.rst
+++ clang/docs/ClangFormat.rst
@@ -145,8 +145,13 @@
 
 .. code-block:: vim
 
-  map <C-K> :pyf <path-to-this-file>/clang-format.py<cr>
-  imap <C-K> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  if has('python')
+    map <C-K> :pyf <path-to-this-file>/clang-format.py<cr>
+    imap <C-K> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
+  elseif has('python3')
+    map <C-K> :py3f <path-to-this-file>/clang-format.py<cr>
+    imap <C-K> <c-o>:py3f <path-to-this-file>/clang-format.py<cr>
+  endif
 
 The first line enables :program:`clang-format` for NORMAL and VISUAL mode, the
 second line adds support for INSERT mode. Change "C-K" to another binding if


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153338.533149.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230621/817ed9fd/attachment.bin>


More information about the cfe-commits mailing list