summaryrefslogtreecommitdiff
path: root/plugin/autocmd.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/autocmd.lua')
-rw-r--r--plugin/autocmd.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugin/autocmd.lua b/plugin/autocmd.lua
new file mode 100644
index 0000000..21b5f9f
--- /dev/null
+++ b/plugin/autocmd.lua
@@ -0,0 +1,13 @@
+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]] })