From de146ec6ded61cf5cc842754c549d509f580db9b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 3 Jul 2024 12:42:34 +0200 Subject: [PATCH] QoL: highlighting and feeback --- lua/keymaps.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 4825d2a..630599f 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -102,8 +102,12 @@ local function global_cmd_yank() -- Concat matches according to separator local value = table.concat(extracted, outsep) + -- Trigger global search to highlight results + vim.cmd('g/' .. inexpr .. '/') -- Write to system register vim.fn.setreg('+', value) + + print('Found ' .. #extracted .. ' results!') end vim.keymap.set({ 'n', 'v' }, 'gy', global_cmd_yank, { desc = '[G]lobal command [Y]ank' })