feat(nvim): add go.nvim plugin to support golang

This commit is contained in:
Price Hiller 2024-02-09 17:10:09 -06:00
parent 606219a776
commit b013098bfe
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 28 additions and 13 deletions

View 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
},
}

View File

@ -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