" 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 " 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 ' . fnameescape(expand('%:p:h')) nmap z (go-alternate-edit) nmap z (go-alternate-vertical) nmap Ze (go-iferr)