" go_jump_to_error defines whether we should pass the bang attribute to the " command or not. This is only used for mappings, because the user can't pass " the bang attribute to the plug mappings below. So instead of hardcoding it " as 0 (no '!' attribute) or 1 (with '!' attribute) we pass the user setting, " which by default is enabled. For commands the user has the ability to pass " the '!', such as :GoBuild or :GoBuild! if !exists("g:go_jump_to_error") let g:go_jump_to_error = 1 endif " Some handy plug mappings nnoremap (go-run) :call go#cmd#Run(!g:go_jump_to_error, '%') if has("nvim") nnoremap (go-run-vertical) :call go#cmd#RunTerm('vsplit') nnoremap (go-run-split) :call go#cmd#RunTerm('split') nnoremap (go-run-tab) :call go#cmd#RunTerm('tab') endif nnoremap (go-build) :call go#cmd#Build(!g:go_jump_to_error) nnoremap (go-generate) :call go#cmd#Generate(!g:go_jump_to_error) nnoremap (go-install) :call go#cmd#Install(!g:go_jump_to_error) nnoremap (go-test) :call go#cmd#Test(!g:go_jump_to_error, 0) nnoremap (go-test-func) :call go#cmd#TestFunc(!g:go_jump_to_error) nnoremap (go-test-compile) :call go#cmd#Test(!g:go_jump_to_error, 1) nnoremap (go-coverage) :call go#cmd#Coverage(!g:go_jump_to_error) nnoremap (go-files) :call go#tool#Files() nnoremap (go-deps) :call go#tool#Deps() nnoremap (go-info) :call go#complete#Info() nnoremap (go-import) :call go#import#SwitchImport(1, '', expand(''), '') nnoremap (go-implements) :call go#oracle#Implements(-1) nnoremap (go-callees) :call go#oracle#Callees(-1) nnoremap (go-callers) :call go#oracle#Callers(-1) nnoremap (go-describe) :call go#oracle#Describe(-1) nnoremap (go-callstack) :call go#oracle#Callstack(-1) nnoremap (go-freevars) :call go#oracle#Freevars(-1) nnoremap (go-channelpeers) :call go#oracle#ChannelPeers(-1) nnoremap (go-referrers) :call go#oracle#Referrers(-1) nnoremap (go-rename) :call go#rename#Rename(!g:go_jump_to_error) nnoremap (go-def) :call go#def#Jump() nnoremap (go-def-vertical) :call go#def#JumpMode("vsplit") nnoremap (go-def-split) :call go#def#JumpMode("split") nnoremap (go-def-tab) :call go#def#JumpMode("tab") nnoremap (go-doc) :call go#doc#Open("new", "split") nnoremap (go-doc-tab) :call go#doc#Open("tabnew", "tabe") nnoremap (go-doc-vertical) :call go#doc#Open("vnew", "vsplit") nnoremap (go-doc-split) :call go#doc#Open("new", "split") nnoremap (go-doc-browser) :call go#doc#OpenBrowser() nnoremap (go-metalinter) :call go#lint#Gometa(0) nnoremap (go-vet) :call go#lint#Vet(!g:go_jump_to_error)