feat(nvim): add go.nvim plugin to support golang
This commit is contained in:
parent
606219a776
commit
b013098bfe
25
dots/.config/nvim/lua/plugins/configs/go.lua
Normal file
25
dots/.config/nvim/lua/plugins/configs/go.lua
Normal file
@ -0,0 +1,25 @@
|
||||
return {
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup({
|
||||
max_line_len = vim.opt.textwidth,
|
||||
lsp_keymaps = false,
|
||||
dap_debug_keymap = false,
|
||||
lsp_codelens = false,
|
||||
icons = false,
|
||||
run_in_floaterm = true,
|
||||
trouble = true,
|
||||
luasnip = true
|
||||
})
|
||||
end,
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod" },
|
||||
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
||||
},
|
||||
}
|
@ -446,19 +446,9 @@ return {
|
||||
lspconfig.gopls.setup({
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
gopls = {
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
fillstruct = 'gopls',
|
||||
dap_debug = true,
|
||||
dap_debug_gui = true
|
||||
})
|
||||
|
||||
-- NOTE: GENERIC LSP SERVERS
|
||||
|
Loading…
Reference in New Issue
Block a user