mac-dotfiles/config/nvim/lua/plugins/go.lua

23 lines
649 B
Lua
Raw Normal View History

2024-08-30 23:09:35 +00:00
return {
'ray-x/go.nvim',
dependencies = {
'ray-x/guihua.lua',
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('go').setup()
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require('go.format').goimports()
end,
group = format_sync_grp,
})
end,
event = {'CmdlineEnter'},
ft = {'go', 'gomod'},
build = ':lua require("go.install").update_all_sync()'
}