feat(defaults): map Q and @x to repeat in Visual mode (#26495)

This commit is contained in:
Nacho Nieva
2023-12-26 20:26:18 -03:00
committed by GitHub
parent 5cb906e91c
commit c26dc1f77c
6 changed files with 112 additions and 1 deletions

View File

@@ -67,6 +67,21 @@ do
--- See |&-default|
vim.keymap.set('n', '&', ':&&<CR>', { desc = ':help &-default' })
--- Use Q in visual mode to execute a macro on each line of the selection. #21422
---
--- Applies to @x and includes @@ too.
vim.keymap.set(
'x',
'Q',
':normal! @<C-R>=reg_recorded()<CR><CR>',
{ silent = true, desc = ':help v_Q-default' }
)
vim.keymap.set(
'x',
'@',
"':normal! @'.getcharstr().'<CR>'",
{ silent = true, expr = true, desc = ':help v_@-default' }
)
--- Map |gx| to call |vim.ui.open| on the identifier under the cursor
do
-- TODO: use vim.region() when it lands... #13896 #16843