Remix.run Logo
thdhhghgbhy 11 hours ago

For searching file contents, is there a way to start rg with no search string?

burntsushi 10 hours ago | parent [-]

What do you mean? You could pass an empty pattern. But that will match everything.

Maybe talk about your use case at a higher level.

thdhhghgbhy 10 hours ago | parent [-]

Thanks for the response. I would like to use fzf with rg to search file contents with a previewer open. However when I first open fzf I don't wish to pass any argument to rg, until I start typing. Something like Telescope live_grep.

burntsushi 10 hours ago | parent | next [-]

That's more a question for fzf than for ripgrep. ripgrep doesn't have any interactive mode. You give it arguments and it runs. That's it. ripgrep doesn't have any mode where it waits for user input (unless it's waiting for stdin).

tasuki 9 hours ago | parent [-]

You could have incorporated some snark or something, but no, you're always the most helpful you can be. You're very inspirational - thank you!

(Also like thanks for ripgrep I guess?)

thdhhghgbhy 8 hours ago | parent [-]

>You could have incorporated some snark

Why even say this?

bombela 6 hours ago | parent | prev | next [-]

Similar to other answers. With a nasty mix of vimscript generating shell commands for fzf to use, that's how I integrated rg and fd with "fzf.vim" in my neovim.

https://github.com/bombela/fzf.vim.rgfd

Nasty, but it works hey!

CorrectHorseBat 8 hours ago | parent | prev [-]

Certainly possible with fzf, everything you need is in the fzf docs. Here's something in vimscript (sorry) that does that: https://github.com/Emilv2/siefe.vim/blob/8432406581acbf450b5...

thdhhghgbhy 8 hours ago | parent [-]

Thanks. You've put some work into this.