Files
kickstart-nvim/lua/custom/plugins/vim-go.lua
2025-05-12 22:04:49 +10:00

27 lines
907 B
Lua

return {
'fatih/vim-go', -- Popular Go plugin
config = function()
-- Explicitly set Go-specific indentation
vim.api.nvim_create_augroup('GoIndentation', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
group = 'GoIndentation',
pattern = 'go',
callback = function()
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4
vim.opt_local.softtabstop = 4
vim.opt_local.expandtab = false -- Go prefers tabs, not spaces
end,
})
-- Additional Go-specific settings
vim.g.go_fmt_command = 'goimports' -- Automatically import packages
vim.g.go_auto_type_info = 1 -- Show type information
vim.g.go_highlight_types = 1
vim.g.go_highlight_fields = 1
vim.g.go_highlight_functions = 1
vim.g.go_highlight_function_calls = 1
vim.g.go_highlight_operators = 1
vim.g.go_highlight_extra_types = 1
end,
}