[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
This commit is contained in:
Jannik Silvanus
2023-06-20 15:22:32 +02:00
parent 7fc0efd0dc
commit 9741ac5b3b

View File

@@ -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