Author: Jannik Silvanus Date: 2023-06-21T17:18:36+02:00 New Revision: 9741ac5b3b3e7942e3332e37af829e58e5e2bb82
URL: https://github.com/llvm/llvm-project/commit/9741ac5b3b3e7942e3332e37af829e58e5e2bb82 DIFF: https://github.com/llvm/llvm-project/commit/9741ac5b3b3e7942e3332e37af829e58e5e2bb82.diff LOG: [clang-format] vim integration: Mention python3 variant of bindings The instructions in the documentation only mentioned how to include bindings for clang-format into vim using python2. Add the instructions for python3 which were already present in the source comments. Differential Revision: https://reviews.llvm.org/D153338 Change-Id: I25fdbd36f0c7e745061908be8e26f68cb31c7dd5 Added: Modified: clang/docs/ClangFormat.rst Removed: ################################################################################ diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst index 98350a04ccda4..129d5f101a0c4 100644 --- a/clang/docs/ClangFormat.rst +++ b/clang/docs/ClangFormat.rst @@ -145,8 +145,13 @@ This can be integrated by adding the following to your `.vimrc`: .. 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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits