mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 19:30:01 +02:00
17 lines
478 B
Lua
17 lines
478 B
Lua
local autocmd = vim.api.nvim_create_autocmd
|
|
local augroup = vim.api.nvim_create_augroup
|
|
|
|
-- Highlight on yank
|
|
autocmd("TextYankPost", {
|
|
group = vim.api.nvim_create_augroup("highlight_yank", {}),
|
|
desc = "Hightlight selection on yank",
|
|
pattern = "*",
|
|
callback = function()
|
|
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 400 })
|
|
end,
|
|
})
|
|
|
|
-- Remove all trailing whitespaces on save
|
|
autocmd("BufWritePre", {
|
|
command = [[:exe 'norm m`' | %s/\s\+$//eg | norm ``]],
|
|
})
|