blob: 1dc680ddfa25d5a425be23669a0c6766d7d3c875 (
plain)
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
41
42
|
" Go vim settings
if exists('b:did_ftplugin')
unlet b:did_ftplugin
endif
compiler go
" Compile package
nnoremap <buffer> <leader>cc :make<cr>
" Compile file
nnoremap <buffer> <leader>cd :make %<cr>
" Compile & run file
nnoremap <buffer> <leader>cr :!go run %<cr>
" Format
nnoremap <buffer> cdf :!go fmt %<cr>
" Comment string
setlocal commentstring=//\ %s
" Add a trailing comma when expanding elements to multiple lines
let b:argwrap_tail_comma = 1
nmap <buffer> Zr :GoRun .<CR>
nmap <buffer> Zb <Plug>(go-build)
nmap <buffer> Zc <Plug>(go-test-compile)
nmap <buffer> Zf <Plug>(go-imports)
nmap <buffer> <leader>z <Plug>(go-test)
nmap <buffer> <leader>Z <Plug>(go-test-func)
nnoremap <buffer> Zs :execute '!go test ' . fnameescape(expand('%:p:h'))<CR>
nmap <buffer> z<C-^> :call go#alternate#Switch(1, 'edit')<CR>
nmap <buffer> <C-w>z<C-^> :call go#alternate#Switch(1, 'vsplit')<CR>
nmap <buffer> Ze <Plug>(go-iferr)
|