File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 2
2
# - Change 'binary' if clang-format is not on the path (see below).
3
3
# - Add to your .vimrc:
4
4
#
5
- # map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
6
- # imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
5
+ # if has('python')
6
+ # map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
7
+ # imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
8
+ # elseif has('python3')
9
+ # map <C-I> :py3f <path-to-this-file>/clang-format.py<cr>
10
+ # imap <C-I> <c-o>:py3f <path-to-this-file>/clang-format.py<cr>
11
+ # endif
7
12
#
8
- # The first line enables clang-format for NORMAL and VISUAL mode, the second
9
- # line adds support for INSERT mode. Change "C-I" to another binding if you
13
+ # The if-elseif-endif conditional should pick either the python3 or python2
14
+ # integration depending on your vim setup.
15
+ #
16
+ # The first mapping enables clang-format for NORMAL and VISUAL mode, the second
17
+ # mapping adds support for INSERT mode. Change "C-I" to another binding if you
10
18
# need clang-format on a different key (C-I stands for Ctrl+i).
11
19
#
12
20
# With this integration you can press the bound key and clang-format will
20
28
# like:
21
29
# :function FormatFile()
22
30
# : let l:lines="all"
23
- # : pyf <path-to-this-file>/clang-format.py
31
+ # : if has('python')
32
+ # : pyf <path-to-this-file>/clang-format.py
33
+ # : elseif has('python3')
34
+ # : py3f <path-to-this-file>/clang-format.py
35
+ # : endif
24
36
# :endfunction
25
37
#
26
38
# It operates on the current, potentially unsaved buffer and does not create
You can’t perform that action at this time.
0 commit comments