summaryrefslogtreecommitdiff
path: root/lua/utility/autocmd.lua
blob: 948497d4d9a16556bf9e27245385d21c2af34a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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