diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /tools/clang-format/clang-format.py | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) |
Notes
Diffstat (limited to 'tools/clang-format/clang-format.py')
-rw-r--r-- | tools/clang-format/clang-format.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py index 16a187910832..a79205a6dfe8 100644 --- a/tools/clang-format/clang-format.py +++ b/tools/clang-format/clang-format.py @@ -2,8 +2,8 @@ # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # -# map <C-I> :pyf <path-to-this-file>/clang-format.py<CR> -# imap <C-I> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i +# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> +# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> # # The first line enables clang-format for NORMAL and VISUAL mode, the second # line adds support for INSERT mode. Change "C-I" to another binding if you @@ -23,8 +23,11 @@ import subprocess import sys import vim +# set g:clang_format_path to the path to clang-format if it is not on the path # Change this to the full path if clang-format is not on the path. binary = 'clang-format' +if vim.eval('exists("g:clang_format_path")') == "1": + binary = vim.eval('g:clang_format_path') # Change this to format according to other formatting styles. See the output of # 'clang-format --help' for a list of supported styles. The default looks for |