Closed Accelx9 closed 2 years ago
SOLVED:
For newcomers like me follow the next steps:
For fd: $env:FZF_DEFAULT_COMMAND='fd --ignore-file .gitignore'
For ripgrep $env:FZF_DEFAULT_COMMAND='rg --files --hidden --no-require-git'
I hope this helps someone.
Merry Christmas.
also can simply list directory names in FZF_DEFAULT_COMMAND like this: $env:FZF_DEFAULT_COMMAND='rg --files --hidden -g !.idea -g !__pycache -g !.git'
the trick here is the "-g !" option. you might want to take a look at the man pages of rg.
rg --help
...
-g, --glob
As an extension, globs support specifying alternatives: *-g ab{c,d}* is
equivalet to *-g abc -g abd*. Empty alternatives like *-g ab{,c}* are not
currently supported. Note that this syntax extension is also currently enabled
in gitignore files, even though this syntax isn't supported by git itself.
ripgrep may disable this syntax extension in gitignore files, but it will
always remain available via the -g/--glob flag.
When this flag is set, every file and directory is applied to it to test for
a match. So for example, if you only want to search in a particular directory
'foo', then *-g foo* is incorrect because 'foo/bar' does not match the glob
'foo'. Instead, you should use *-g 'foo/**'*.
fzf version: 0.28.0 PSFzf version: 2.2.9
I would like to know how I can ignore multiple directories in PSFzf. For example: node modules, .git directories, etc.
I have tried creating a global .gitignore file via core.excludesFile but didn't work.
How can I do this?