Put options in same order in README.md, go.txt, go.lua (#72)
This commit is contained in:
parent
2fdcb8d60b
commit
a54f5d452f
12
README.md
12
README.md
@ -405,6 +405,7 @@ Configure from lua suggested, The default setup:
|
||||
```lua
|
||||
require('go').setup({
|
||||
goimport='gopls', -- goimport command, can be gopls[default] or goimport
|
||||
fillstruct = 'gopls', -- can be nil (use fillstruct, slower) and gopls
|
||||
gofmt = 'gofumpt', --gofmt cmd,
|
||||
max_line_len = 120, -- max line length in goline format
|
||||
tag_transform = false, -- tag_transfer check gomodifytags for details
|
||||
@ -422,19 +423,18 @@ require('go').setup({
|
||||
-- when lsp_cfg is true
|
||||
-- if lsp_on_attach is a function: use this function as on_attach function for gopls
|
||||
lsp_codelens = true, -- set to false to disable codelens, true by default
|
||||
gopls_remote_auto = true, -- add -remote=auto to gopls
|
||||
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" }
|
||||
fillstruct = 'gopls', -- can be nil (use fillstruct, slower) and gopls
|
||||
lsp_diag_hdlr = true, -- hook lsp diag handler
|
||||
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" }
|
||||
gopls_remote_auto = true, -- add -remote=auto to gopls
|
||||
dap_debug = true, -- set to false to disable dap
|
||||
textobjects = true, -- enable default text jobects through treesittter-text-objects
|
||||
test_runner = 'go', -- richgo, go test, richgo, dlv, ginkgo
|
||||
run_in_floaterm = false, -- set to true to run in float window.
|
||||
--float term recommand if you use richgo/ginkgo with terminal color
|
||||
dap_debug_keymap = true, -- set keymaps for debugger
|
||||
dap_debug_gui = true, -- set to true to enable dap gui, highly recommand
|
||||
dap_debug_vt = true, -- set to true to enable dap virtual text
|
||||
build_tags = "tag1,tag2" -- set default build tags
|
||||
build_tags = "tag1,tag2", -- set default build tags
|
||||
run_in_floaterm = false, -- set to true to run in float window.
|
||||
--float term recommand if you use richgo/ginkgo with terminal color
|
||||
})
|
||||
```
|
||||
|
||||
|
@ -267,16 +267,16 @@ You can setup go.nvim with following options:
|
||||
lsp_gofumpt = false, -- true: set default gofmt in gopls format to gofumpt
|
||||
lsp_on_attach = nil, -- nil: do nothing
|
||||
-- if lsp_on_attach is a function: use this function as on_attach function for gopls,
|
||||
when lsp_cfg is true
|
||||
lsp_diag_hdlr = true, -- hook lsp diag handler
|
||||
-- when lsp_cfg is true
|
||||
lsp_codelens = true,
|
||||
lsp_diag_hdlr = true, -- hook lsp diag handler
|
||||
gopls_remote_auto = true,
|
||||
gocoverage_sign = "█",
|
||||
gocoverage_sign_priority = 5,
|
||||
dap_debug = true,
|
||||
textobjects = true,
|
||||
dap_debug_gui = true,
|
||||
dap_vt = true, -- false, true and 'all frames'
|
||||
textobjects = true,
|
||||
gopls_cmd = nil, --- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls" }
|
||||
build_tags = "", --- you can provide extra build tags for tests or debugger
|
||||
test_runner = "go", -- richgo, go test, richgo, dlv, ginkgo
|
||||
|
22
lua/go.lua
22
lua/go.lua
@ -1,5 +1,8 @@
|
||||
-- some of commands extracted from gopher.vim
|
||||
local go = {}
|
||||
|
||||
-- Keep this in sync with README.md
|
||||
-- Keep this in sync with doc/go.txt
|
||||
_GO_NVIM_CFG = {
|
||||
goimport = "gopls", -- if set to 'gopls' will use gopls format, also goimport
|
||||
fillstruct = "gopls",
|
||||
@ -12,24 +15,25 @@ _GO_NVIM_CFG = {
|
||||
verbose = false,
|
||||
log_path = vim.fn.expand("$HOME") .. "/tmp/gonvim.log",
|
||||
lsp_cfg = false, -- false: do nothing
|
||||
-- true: apply non-default gopls setup defined in go/lsp.lua
|
||||
-- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g.
|
||||
-- true: apply non-default gopls setup defined in go/lsp.lua
|
||||
-- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g.
|
||||
lsp_gofumpt = false, -- true: set default gofmt in gopls format to gofumpt
|
||||
lsp_on_attach = nil, -- nil: use on_attach function defined in go/lsp.lua for gopls,
|
||||
-- when lsp_cfg is true
|
||||
-- if lsp_on_attach is a function: use this function as on_attach function for gopls,
|
||||
-- when lsp_cfg is true
|
||||
lsp_diag_hdlr = true, -- hook lsp diag handler
|
||||
-- when lsp_cfg is true
|
||||
-- if lsp_on_attach is a function: use this function as on_attach function for gopls,
|
||||
-- when lsp_cfg is true
|
||||
lsp_codelens = true,
|
||||
lsp_diag_hdlr = true, -- hook lsp diag handler
|
||||
gopls_cmd = nil, --- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls" }
|
||||
build_tags = "", --- you can provide extra build tags for tests or debugger
|
||||
gopls_remote_auto = true,
|
||||
gocoverage_sign = "█",
|
||||
gocoverage_sign_priority = 5,
|
||||
dap_debug = true,
|
||||
textobjects = true,
|
||||
|
||||
dap_debug_gui = true,
|
||||
dap_vt = true, -- false, true and 'all frames'
|
||||
gopls_cmd = nil, --- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls" }
|
||||
build_tags = "", --- you can provide extra build tags for tests or debugger
|
||||
textobjects = true,
|
||||
test_runner = "go", -- richgo, go test, richgo, dlv, ginkgo
|
||||
run_in_floaterm = false, -- set to true to run in float window.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user