" Go vim settings if exists('b:did_ftplugin') unlet b:did_ftplugin endif compiler go " Compile package nnoremap cc :make " Compile file nnoremap cd :make % " Compile & run file nnoremap cr :!go run % " Format nnoremap cdf :!go fmt % " Comment string setlocal commentstring=//\ %s " Continue comments on and `o` `O`. setlocal formatoptions+=or " Add a trailing comma when expanding elements to multiple lines let b:argwrap_tail_comma = 1 nmap Zr :GoRun . nmap Zb (go-build) nmap Zc (go-test-compile) nmap Zf (go-imports) nmap z (go-test) nmap Z (go-test-func) nnoremap Zs :execute '!go test -v ' . fnameescape(expand('%:p:h')) nmap z :call go#alternate#Switch(1, 'edit') nmap z :call go#alternate#Switch(1, 'vsplit') nmap Ze (go-iferr)