|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
-- some of commands extracted from gopher.vim
|
|
|
|
|
|
|
|
|
|
local go = {}
|
|
|
|
|
|
|
|
|
|
function go.setup(cfg)
|
|
|
|
@ -13,9 +12,8 @@ function go.setup(cfg)
|
|
|
|
|
vim.g.go_nvim_verbose = cfg.verbose or false -- output loginf in messages
|
|
|
|
|
vim.cmd("command! Gmake silent lua require'go.asyncmake'.make()")
|
|
|
|
|
|
|
|
|
|
vim.cmd('command Gofmt lua require("go.format").gofmt()')
|
|
|
|
|
vim.cmd('command Goimport lua require("go.format").goimport()')
|
|
|
|
|
|
|
|
|
|
vim.cmd('command! Gofmt lua require("go.format").gofmt()')
|
|
|
|
|
vim.cmd('command! Goimport lua require("go.format").goimport()')
|
|
|
|
|
|
|
|
|
|
vim.cmd([[command GoBuild :setl makeprg=go\ build | :Gmake]])
|
|
|
|
|
vim.cmd([[command GoGenerate :setl makeprg=go\ generate | :Gmake]])
|
|
|
|
@ -25,21 +23,21 @@ function go.setup(cfg)
|
|
|
|
|
vim.cmd([[command GoTest :setl makeprg=go\ test\ ./... | :Gmake]])
|
|
|
|
|
vim.cmd([[command GoTestCompile setl makeprg=go\ build | :Gmake]])
|
|
|
|
|
|
|
|
|
|
vim.cmd([[command GoAddTest lua require("go.gotests").fun_test()]])
|
|
|
|
|
vim.cmd([[command GoAddExpTest lua require("go.gotests").exported_test()]])
|
|
|
|
|
vim.cmd([[command GoAddAllTest lua require("go.gotests").all_test()]])
|
|
|
|
|
vim.cmd([[command! GoAddTest lua require("go.gotests").fun_test()]])
|
|
|
|
|
vim.cmd([[command! GoAddExpTest lua require("go.gotests").exported_test()]])
|
|
|
|
|
vim.cmd([[command! GoAddAllTest lua require("go.gotests").all_test()]])
|
|
|
|
|
|
|
|
|
|
vim.cmd([[command! -nargs=* GoAddTag lua require("go.tags").add(<f-args>)]])
|
|
|
|
|
vim.cmd([[command! -nargs=* GoRmTag lua require("go.tags").rm(<f-args>)]])
|
|
|
|
|
vim.cmd([[command GoClearTag lua require("go.tags").clear()]])
|
|
|
|
|
vim.cmd([[command GoCmt lua require("go.comment").gen()]])
|
|
|
|
|
vim.cmd([[command GoRename lua require("go.rename").run()]])
|
|
|
|
|
vim.cmd([[command Giferr lua require("go.iferr").run()]])
|
|
|
|
|
vim.cmd([[command Gfstruct lua require("go.reftool").fillstruct()]])
|
|
|
|
|
vim.cmd([[command Gfswitch lua require("go.reftool").fillstruct()]])
|
|
|
|
|
vim.cmd([[command! GoClearTag lua require("go.tags").clear()]])
|
|
|
|
|
vim.cmd([[command! GoCmt lua require("go.comment").gen()]])
|
|
|
|
|
vim.cmd([[command! GoRename lua require("go.rename").run()]])
|
|
|
|
|
vim.cmd([[command! Giferr lua require("go.iferr").run()]])
|
|
|
|
|
vim.cmd([[command! Gfstruct lua require("go.reftool").fillstruct()]])
|
|
|
|
|
vim.cmd([[command! Gfswitch lua require("go.reftool").fillstruct()]])
|
|
|
|
|
|
|
|
|
|
-- vim.cmd([[command GoLint :compiler golangci-lint run | :Gmake]])
|
|
|
|
|
vim.cmd([[command GoLint :setl makeprg=golangci-lint\ run\ --out-format\ tab | :Gmake]])
|
|
|
|
|
vim.cmd([[command! GoLint :setl makeprg=golangci-lint\ run\ --out-format\ tab | :Gmake]])
|
|
|
|
|
vim.cmd("au FileType go au QuickFixCmdPost [^l]* nested cwindow")
|
|
|
|
|
vim.cmd("au FileType go au QuickFixCmdPost l* nested lwindow")
|
|
|
|
|
|
|
|
|
|