Open ruilya opened 5 months ago
@ruilya this is my solution;
vim.keymap.set("n", "<C-b>", function()
-- loop though and save .go files only
for i, buf_hndl in ipairs(vim.api.nvim_list_bufs()) do
fileType = vim.fn.getbufvar(buf_hndl, "&filetype")
if fileType == "go" then
vim.api.nvim_buf_call(buf_hndl, function()
vim.cmd('w')
end)
end
end
vim.api.nvim_command([[:GoBuild]])
end, { silent = true, noremap = true })
Is it possible to make
:GoBuild
respectautowrite
setting? It would be rather convenient to write all unsaved buffers before building. Same goes for:GoTest
.Thank you.