summaryrefslogtreecommitdiffstats
path: root/tools/clang-format/clang-format.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/clang-format/clang-format.py')
-rw-r--r--tools/clang-format/clang-format.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py
index 16a1879..a79205a 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
OpenPOWER on IntegriCloud