" 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(!g:go_jump_to_error, 'vsplit', []) nnoremap (go-run-split) :call go#cmd#RunTerm(!g:go_jump_to_error, 'split', []) nnoremap (go-run-tab) :call go#cmd#RunTerm(!g:go_jump_to_error, 'tabe', []) 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#coverage#Buffer(!g:go_jump_to_error) nnoremap (go-coverage-clear) :call go#coverage#Clear() nnoremap (go-coverage-toggle) :call go#coverage#BufferToggle(!g:go_jump_to_error) nnoremap (go-coverage-browser) :call go#coverage#Browser(!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(0) nnoremap (go-import) :call go#import#SwitchImport(1, '', expand(''), '') nnoremap (go-imports) :call go#fmt#Format(1) nnoremap (go-implements) :call go#guru#Implements(-1) nnoremap (go-callees) :call go#guru#Callees(-1) nnoremap (go-callers) :call go#guru#Callers(-1) nnoremap (go-describe) :call go#guru#Describe(-1) nnoremap (go-callstack) :call go#guru#Callstack(-1) xnoremap (go-freevars) :call go#guru#Freevars(0) nnoremap (go-channelpeers) :call go#guru#ChannelPeers(-1) nnoremap (go-referrers) :call go#guru#Referrers(-1) nnoremap (go-sameids) :call go#guru#SameIds(-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#Jump("vsplit") nnoremap (go-def-split) :call go#def#Jump("split") nnoremap (go-def-tab) :call go#def#Jump("tab") nnoremap (go-def-pop) :call go#def#StackPop() nnoremap (go-def-stack) :call go#def#Stack() nnoremap (go-def-stack-clear) :call go#def#StackClear() 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) nnoremap (go-alternate-edit) :call go#alternate#Switch(0, "edit") nnoremap (go-alternate-vertical) :call go#alternate#Switch(0, "vsplit") nnoremap (go-alternate-split) :call go#alternate#Switch(0, "split") " vim: sw=2 ts=2 et