-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.vim
41 lines (32 loc) · 1018 Bytes
/
vimrc.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
" See README.md for installation instructions
" adjust these variables
let g:teamscale#user='your teamscale login'
let g:teamscale#accesskey='your teamscale IDE accesskey'
" set this, unless the teamscale-dev command-line tool is already on your PATH
let g:teamscale#devpath='/path/to/teamscale-dev'
function! s:precommit() abort
let previous_compiler = ""
if exists("b:current_compiler")
let previous_compiler = b:current_compiler
endif
compiler teamscale
if !exists('b:teamscale')
return
endif
if empty(expand("%"))
echoe "The current buffer is not a file"
return
endif
w
make %
" use silent make % to not see the output
if !empty(previous_compiler)
execute "compiler " .. previous_compiler
endif
cwindow
endfunction
" Writes the current buffer, then runs pre-commit and shows the results in the
" quickfix window
command! Precommit call s:precommit()
" adjust the mapping to your likes
map <f5> :Precommit<cr>