1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-17 03:30:01 +02:00

touching the nvim again

This commit is contained in:
Henrik Hautakoski 2024-05-14 11:37:21 +02:00
parent c05ca4cb35
commit bcb84e54eb
11 changed files with 120 additions and 47 deletions

View file

@ -1,5 +1,15 @@
local autocmd = vim.api.nvim_create_autocmd
-- 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 ``]]