function autocmd(event, pattern, command) vim.cmd("autocmd " .. event .. " " .. pattern .. " " .. command) end function augroup(name, autocommands) vim.cmd("augroup " .. name) vim.cmd("autocmd!") for _, autocmd_args in ipairs(autocommands) do autocmd(unpack(autocmd_args)) end vim.cmd("augroup end") end