From e3fd51d1892b8a45aa346602429f335927f3ca7d Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Mon, 23 Sep 2024 03:28:35 +0200 Subject: [PATCH] feat: Add yank highlight --- nvim/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nvim/init.lua b/nvim/init.lua index 8ec4114..72813ae 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -25,6 +25,14 @@ opt.relativenumber = true opt.cursorline = true opt.lazyredraw = true opt.showmatch = true -- Highlight matching parentheses, etc +vim.api.nvim_create_autocmd('TextYankPost', { -- Highlight yank + group = vim.api.nvim_create_augroup('highlight_yank', {}), + desc = 'Hightlight selection on yank', + pattern = '*', + callback = function() + vim.highlight.on_yank { higroup = 'IncSearch', timeout = 200 } + end, +}) opt.incsearch = true opt.hlsearch = true opt.ignorecase = true -- Make search case insensitive