jremmen / vim-ripgrep

Use RipGrep in Vim and display results in a quickfix list
MIT License
542 stars 99 forks source link

suggestion: let user control "search in this dir and subdirs" vs "search within project dir" in a more interactive way #1

Open Dieterbe opened 7 years ago

Dieterbe commented 7 years ago

seems like this behavior can currently only be toggled via the g:rg_derive_root setting. it would be nice if there was a way to override the setting, and interactively trigger a search in the entire project dir, or force only to search in CWD and below.

thoughts?

PS: cool plugin, thank you!

jremmen commented 7 years ago

Yeah that sounds like a useful thing to have. Maybe a command that searches with the setting flipped? Or would it be more useful to have an easy way to toggle the setting and then combine that with the current search method manually?

Dieterbe commented 7 years ago

I need to use this a bit more to form a decent opinion, but I think i'll be using both in-project search and in-cwd search, and i see both as a search action i will want to be able invoke interactively on an as needed basis. I definitely would avoid doing it as 2 commands (a toggle or a config set followed by the actual search), that's too many keypresses and too much mental overhead.

I already use map <leader>rg :Rg<space> . i could probably finagle out a mapping that woud set the option, do a search, and then unset the option again. but it just seems easier if that functionality was in the plugin.

anyway just my thoughts. cheers.