From 3c238894c5b6f15c5f27cea8bd3785eb0f1ebf0f Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 18 Sep 2022 11:39:25 +0200 Subject: add config --- lua/utility/autocmd.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lua/utility/autocmd.lua (limited to 'lua/utility/autocmd.lua') diff --git a/lua/utility/autocmd.lua b/lua/utility/autocmd.lua new file mode 100644 index 0000000..948497d --- /dev/null +++ b/lua/utility/autocmd.lua @@ -0,0 +1,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 + -- cgit v1.2.3-18-g5258