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:
2024-05-25 11:03:06 +01:00
parent 1996e631a3
commit fcd5cfbd54
3 changed files with 24 additions and 6 deletions

View File

@@ -36,7 +36,6 @@ return {
vim.keymap.set('n', '<leader>gF', builtin.find_files, opts)
vim.keymap.set('n', '<leader>gf', builtin.git_files, opts)
vim.keymap.set('n', '<leader>gg', builtin.live_grep, opts)
vim.keymap.set('n', '<leader>rg', builtin.grep_string, opts)
vim.keymap.set('n', '<leader>gb', builtin.buffers, opts)
vim.keymap.set('n', '<leader>gh', builtin.help_tags, opts)
vim.keymap.set('n', '<leader>bl', builtin.current_buffer_fuzzy_find, opts)