Index: tools/vim/clang-format.vim |
diff --git a/tools/vim/clang-format.vim b/tools/vim/clang-format.vim |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ab91f133b558555f1301cdcd7b050cb393416af3 |
--- /dev/null |
+++ b/tools/vim/clang-format.vim |
@@ -0,0 +1,21 @@ |
+" Copyright (c) 2013 The Chromium Authors. All rights reserved. |
scottmg
2014/01/16 19:42:12
LIVE IN THE NOW
Nico
2014/01/16 19:44:12
but i was younger back then
|
+" Use of this source code is governed by a BSD-style license that can be |
+" found in the LICENSE file. |
+ |
+" Binds cmd-shift-i (on Mac) or ctrl-shift-i (elsewhere) to invoking |
+" clang-format.py. |
+" It will format the current selection (and if there's no selection, the |
+" current line.) |
+ |
+let s:script = expand('<sfile>:p:h') . |
+ \'/../../third_party/clang_format/scripts/clang-format.py' |
+echo s:script |
+ |
+if has('mac') |
+ execute "map <D-I> :pyf " . s:script . "<CR>" |
+ execute "imap <D-I> <ESC>:pyf " . s:script . "<CR>i" |
+else |
+ execute "map <C-I> :pyf " . s:script . "<CR>" |
+ execute "imap <C-I> <ESC>:pyf " . s:script . "<CR>i" |
+endif |
+ |