dotfiles/home/dot_config/nvim/lua/plugins/go.lua
2024-06-26 00:25:23 +08:00

27 lines
616 B
Lua

return {
"fatih/vim-go",
lazy = false,
keys = {},
config = function ()
vim.api.nvim_create_autocmd("FileType", {
pattern = 'go',
callback = function ()
vim.keymap.set('n', '<leader>err', '<Plug>(go-iferr)')
end
})
local g = vim.g
g.go_fmt_fail_silently = 1
g.go_fmt_command = "goimports"
g.go_def_mode = 'gopls'
g.go_decls_includes = "func,type"
g.go_highlight_types = 1
g.go_highlight_fields = 1
g.go_highlight_functions = 1
g.go_highlight_function_calls = 1
g.go_highlight_operators = 1
g.go_highlight_extra_types = 1
end
}