add go makeprg

This commit is contained in:
2025-08-02 16:39:32 +02:00
parent 70dae16ad2
commit f3ecda9b65
+9
View File
@@ -82,6 +82,7 @@ vim.api.nvim_create_autocmd({
end end
}) })
-- set makeprg
vim.api.nvim_create_autocmd('BufEnter', { vim.api.nvim_create_autocmd('BufEnter', {
callback = function() callback = function()
local line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] local line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1]
@@ -89,8 +90,16 @@ vim.api.nvim_create_autocmd('BufEnter', {
local first_two = line:sub(1, 2) local first_two = line:sub(1, 2)
if first_two == '#!' then if first_two == '#!' then
vim.bo.makeprg = './%' vim.bo.makeprg = './%'
return
end end
end end
if vim.bo.filetype == 'go' then
vim.bo.makeprg = 'go $*'
return
end
if vim.bo.filetype == 'c' then
end
end, end,
}) })