2023-04-12 18:09:30 +00:00
|
|
|
require("go").setup({
|
2022-10-01 11:46:18 +00:00
|
|
|
icons = { breakpoint = "", currentpos = "🏃" },
|
2022-10-14 18:40:51 +00:00
|
|
|
fillstruct = "fillstruct",
|
2023-02-13 18:27:17 +00:00
|
|
|
gofmt = "gofumpt",
|
2023-09-22 14:14:42 +00:00
|
|
|
diagnostic = false,
|
2022-10-01 11:46:18 +00:00
|
|
|
})
|
2022-10-14 18:40:51 +00:00
|
|
|
|
2023-04-29 15:09:28 +00:00
|
|
|
require("guihua.maps").setup({
|
|
|
|
maps = { close_view = "<C-x>" },
|
|
|
|
})
|
|
|
|
|
2022-10-14 18:40:51 +00:00
|
|
|
vim.cmd("autocmd FileType go nmap <Leader>gf :lua require('go.format').goimport()<CR>")
|
2024-06-07 15:52:28 +00:00
|
|
|
|
|
|
|
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,
|
|
|
|
})
|
|
|
|
|