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' })