DEV Community

Discussion on: How to Use Fzf with Ripgrep to Selectively Ignore VCS Files

Collapse
 
dietrich profile image
Dietrich Moerman

Great article!

In addition to passing ripgrep options through FZF_DEFAULT_COMMAND, you can as well set the environment variable RIPGREP_CONFIG_PATH to a config file listing the options to apply to ripgrep by default. Over there I set:

--no-ignore-vcs
--hidden
Enter fullscreen mode Exit fullscreen mode

What's even more convenient, though, is to have an ~/.ignore file where you can list directories and files ripgrep should still ignore (but doesn't since we use --no-ignore-vcs):

.git/
node_modules/
Enter fullscreen mode Exit fullscreen mode

This avoids having to define an additional :All vim command and mapping.

Dietrich

Collapse
 
matrixersp profile image
Mohammed Boudad

Thank you!

What's even more convenient, though, is to have an ~/.ignore file where you can list directories and files ripgrep should still ignore (but doesn't since we use --no-ignore-vcs):

I tried with ~/.ignore file but it doesn't work unless created in the working directory, that's why I chose to do it this way.