Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search selection #33

Open
ondrejsevcik opened this issue Oct 31, 2018 · 1 comment
Open

Search selection #33

ondrejsevcik opened this issue Oct 31, 2018 · 1 comment

Comments

@ondrejsevcik
Copy link

Hi, would it be possible to add support to search for what's currently selected?

I like that by default it search for whatever word is under the cursor, but sometimes I need to include other special chars in it and then it's annoying to type it manually. It would be much easier to just select it and run :Rg.

Thanks

@hxegon
Copy link

hxegon commented Nov 14, 2018

This would be cool, but I've made a binding that does this:

nnoremap <leader>r :Rg <C-r>"<CR>

Control-r (<C-r>) in command mode takes a key and pastes whatever is in that key's register. the " register is whatever was last yanked. so this searches for the last thing you yanked.

There's probably a way to have a visual mode binding for this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants