local custom_augroup_id = vim.api.nvim_create_augroup("custom_group", {clear = true})

local aucmd_dict = {
  TermOpen = {
    {
      group   = custom_augroup_id,
      pattern = "*",
      command = "startinsert"
    },
    {
      group   = custom_augroup_id,
      pattern = "*",
      command = "setlocal listchars= nonumber norelativenumber"
    },
  },
  VimResized = {
    {
      group   = custom_augroup_id,
      pattern = "*",
      command = ":wincmd ="
    }
  },
  InsertEnter = {
    {
      group   = custom_augroup_id,
      pattern = "*",
      command = "setlocal nohlsearch"
    }
  },
  TextYankPost = {
    {
      group   = custom_augroup_id,
      pattern = "*",
      callback = function ()
        require("vim.highlight").on_yank({timeout = 1000})
      end,
    }
  },
  VimLeave = {
    {
      group   = custom_augroup_id,
      pattern = "*",
      command = "set guicursor=a:hor1-blinkon0"
    }
  }
}

for event, opt_tbls in pairs(aucmd_dict) do
  for _, opt_tbl in pairs(opt_tbls) do
    vim.api.nvim_create_autocmd(event, opt_tbl)
  end
end
