" 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") || has("terminal") 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#test#Test(!g:go_jump_to_error, 0) nnoremap (go-test-func) :call go#test#Func(!g:go_jump_to_error) nnoremap (go-test-compile) :call go#test#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#tool#Info(1) nnoremap (go-import) :call go#import#SwitchImport(1, '', expand(''), '') nnoremap (go-imports) :call go#fmt#Format(1) nnoremap (go-implements) :call go#implements#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#referrers#Referrers(-1) nnoremap (go-sameids) :call go#guru#SameIds(1) nnoremap (go-pointsto) :call go#guru#PointsTo(-1) nnoremap (go-whicherrs) :call go#guru#Whicherrs(-1) nnoremap (go-sameids-toggle) :call go#guru#ToggleSameIds() nnoremap (go-rename) :call go#rename#Rename(!g:go_jump_to_error) nnoremap (go-decls) :call go#decls#Decls(0, '') nnoremap (go-decls-dir) :call go#decls#Decls(1, '') nnoremap (go-def) :call go#def#Jump('', 0) nnoremap (go-def-vertical) :call go#def#Jump("vsplit", 0) nnoremap (go-def-split) :call go#def#Jump("split", 0) nnoremap (go-def-tab) :call go#def#Jump("tab", 0) nnoremap (go-def-type) :call go#def#Jump('', 1) nnoremap (go-def-type-vertical) :call go#def#Jump("vsplit", 1) nnoremap (go-def-type-split) :call go#def#Jump("split", 1) nnoremap (go-def-type-tab) :call go#def#Jump("tab", 1) 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(!g:go_jump_to_error, 0) nnoremap (go-lint) :call go#lint#Golint(!g:go_jump_to_error) 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") nnoremap (go-iferr) :call go#iferr#Generate() nnoremap (go-diagnostics) :call go#lint#Diagnostics(!g:go_jump_to_error) " vim: sw=2 ts=2 et