Neovim: Add goimports and gofumpt

This commit is contained in:
Tony Grosinger 2024-05-29 07:42:00 -07:00
parent 1508c9cbf7
commit 2c67e9da3d

View File

@ -496,7 +496,9 @@ require('lazy').setup({
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
gopls = {
gofumpt = true,
},
-- pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@ -537,6 +539,8 @@ require('lazy').setup({
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- Used to format Lua code
'goimports', -- Used to format Go code
'gofumpt', -- Used to format Go code
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
@ -581,6 +585,7 @@ require('lazy').setup({
}
end,
formatters_by_ft = {
go = { 'goimports', 'gofumpt' },
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },