Extend :Rg to support visual select mode
Also move away from using the telescope builtin grep for word under cursor mapping by extending the `:Rg` command to work in the following circumstances: * `:Rg text to search for` * `:Rg` word under cursor * `'<,'>Rg` visual selection
This commit is contained in:
@@ -43,3 +43,7 @@ vim.keymap.set('t', '<C-w><C-g>', '<C-\\><C-n>:Gdb<CR>:startinsert<CR>', opts)
|
||||
vim.keymap.set('t', '<C-w><C-e>', '<C-\\><C-n>:Program<CR>', opts)
|
||||
vim.keymap.set('t', '<C-w><C-s>', '<C-\\><C-n>:Source<CR>', opts)
|
||||
vim.keymap.set('t', '<C-w><C-a>', '<C-\\><C-n>:Asm<CR>', opts)
|
||||
|
||||
-- Mappings to grep for then fuzzy find the word under the cursor or visual selection
|
||||
vim.keymap.set('n', '<leader>rg', ':Rg<CR>', opts)
|
||||
vim.keymap.set('v', '<leader>rg', ":'<,'>Rg<CR>", opts)
|
||||
|
||||
Reference in New Issue
Block a user