-- ====================================================================== -- -- automatic commands -- -- ====================================================================== local api = vim.api local all = {"n", "v", "i"} -- Highlights bad whitespace --api.nvim_create_autocmd("ColorScheme", { command = "highlight ExtraWhitespace ctermbg=red guibg=red" }) --api.nvim_create_autocmd("BufWinEnter", { command = "match ExtraWhitespace /\s\+$/" }) --api.nvim_create_autocmd("InsertEnter", { command = "match ExtraWhitespace /\s\+\%#\@", ":GFiles --cached --others --exclude-standard") vim.keymap.set(all, "", ":GFiles?") else vim.keymap.set(all, "", ":Files") end