Commit 502efd81 authored by thakis@chromium.org's avatar thakis@chromium.org

Add a simple script to simplify using clang-format from vim.

BUG=240309
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/140513005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245291 0039d316-1c4b-4281-b951-d872f2087c98
parent d3792b1f
" Copyright (c) 2014 The Chromium Authors. All rights reserved.
" 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment