local autoCmdGroup = vim.api.nvim_create_augroup("autoCmdGroup", { clear = true })
local autoCmd = vim.api.nvim_create_autocmd

-- trim trailing whitespace on save
autoCmd({"BufWritePre"}, {
    group = autoCmdGroup,
    pattern = "*",
    command = [[%s/\s\+$//e]],
})

-- adjust indent spacing for html files
autoCmd({"FileType"}, {
    group = autoCmdGroup,
    pattern = "html",
    callback = function()
        vim.opt_local.shiftwidth = 2
        vim.opt_local.tabstop = 2
        vim.opt_local.softtabstop = 2
    end
})
