OLD | NEW |
---|---|
1 " Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 " Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 " Use of this source code is governed by a BSD-style license that can be | 2 " Use of this source code is governed by a BSD-style license that can be |
3 " found in the LICENSE file. | 3 " found in the LICENSE file. |
4 " | 4 " |
5 " Adds a "Compile this file" function, using ninja. On Mac, binds Cmd-k to | 5 " Adds a "Compile this file" function, using ninja. On Mac, binds Cmd-k to |
6 " this command. On Windows, Ctrl-F7 (which is the same as the VS default). | 6 " this command. On Windows, Ctrl-F7 (which is the same as the VS default). |
7 " On Linux, <Leader>o, which is \o by default ("o"=creates .o files) | 7 " On Linux, <Leader>o, which is \o by default ("o"=creates .o files) |
8 " | 8 " |
9 " Adds a "Build this target" function, using ninja. This is not bound | 9 " Adds a "Build this target" function, using ninja. This is not bound |
10 " to any key by default, but can be used via the :CrBuild command. | 10 " to any key by default, but can be used via the :CrBuild command. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 fun! s:NinjaCommandForTargets(targets) | 102 fun! s:NinjaCommandForTargets(targets) |
103 python compute_ninja_command_for_targets(vim.eval('a:targets')) | 103 python compute_ninja_command_for_targets(vim.eval('a:targets')) |
104 endfun | 104 endfun |
105 | 105 |
106 fun! CrCompileFile() | 106 fun! CrCompileFile() |
107 call s:MakeWithCustomCommand(s:NinjaCommandForCurrentBuffer()) | 107 call s:MakeWithCustomCommand(s:NinjaCommandForCurrentBuffer()) |
108 endfun | 108 endfun |
109 | 109 |
110 fun! CrBuild(...) | 110 fun! CrBuild(...) |
111 let l:targets = a:0 > 0 ? join(a:000, ' ') : '' | 111 let l:targets = a:0 > 0 ? join(a:000, ' ') : '' |
112 if (l:targets !~ "\i") | 112 if (l:targets !~ "\\i") |
reveman
2013/11/07 22:20:17
is this intentional?
enne (OOO)
2013/11/07 22:32:09
OOPS
| |
113 let l:targets = 'chrome' | 113 let l:targets = 'chrome' |
114 endif | 114 endif |
115 call s:MakeWithCustomCommand(s:NinjaCommandForTargets(l:targets)) | 115 call s:MakeWithCustomCommand(s:NinjaCommandForTargets(l:targets)) |
116 endfun | 116 endfun |
117 | 117 |
118 command! CrCompileFile call CrCompileFile() | 118 command! CrCompileFile call CrCompileFile() |
119 command! -nargs=* CrBuild call CrBuild(<q-args>) | 119 command! -nargs=* CrBuild call CrBuild(<q-args>) |
120 | 120 |
121 if has('mac') | 121 if has('mac') |
122 map <D-k> :CrCompileFile<cr> | 122 map <D-k> :CrCompileFile<cr> |
123 imap <D-k> <esc>:CrCompileFile<cr> | 123 imap <D-k> <esc>:CrCompileFile<cr> |
124 elseif has('win32') | 124 elseif has('win32') |
125 map <C-F7> :CrCompileFile<cr> | 125 map <C-F7> :CrCompileFile<cr> |
126 imap <C-F7> <esc>:CrCompileFile<cr> | 126 imap <C-F7> <esc>:CrCompileFile<cr> |
127 elseif has('unix') | 127 elseif has('unix') |
128 map <Leader>o :CrCompileFile<cr> | 128 map <Leader>o :CrCompileFile<cr> |
129 endif | 129 endif |
OLD | NEW |