config.nvim/plugin/autocmd.lua

13 lines
284 B
Lua

local autocmd = vim.api.nvim_create_autocmd
autocmd({ "TextYankPost" }, {
pattern = "*",
callback = function()
vim.highlight.on_yank({
higroup = "IncSearch",
timeout = 50,
})
end,
})
autocmd({ "BufWritePre" }, { pattern = "*", command = [[%s/\s\+$//e]] })