Open DanSM-5 opened 1 year ago
I found this function very useful however having the rg command fixed in the function is somewhat limiting. E.g. I cannot customize the excluded directories to add things like --glob "!node_modules" or allow search in hidden files --hidden.
--glob "!node_modules"
--hidden
The current implementation is like this:
$RG_PREFIX = "rg --column --line-number --no-heading --color=always --smart-case "
It could be refactored to allow a custom rg command to execute the Invoke-PsFzfRipgrep cmdlet.
Invoke-PsFzfRipgrep
$DEFAULT_RG_PREFIX = "rg --column --line-number --no-heading --color=always --smart-case" $RG_PREFIX = if ($env:PSFZF_RG_PREFIX) { $env:PSFZF_RG_PREFIX } else { $DEFAULT_RG_PREFIX }
In the example above the custom variable would be $env:PSFZF_RG_PREFIX but the name is just an example.
$env:PSFZF_RG_PREFIX
I found this function very useful however having the rg command fixed in the function is somewhat limiting. E.g. I cannot customize the excluded directories to add things like
--glob "!node_modules"
or allow search in hidden files--hidden
.The current implementation is like this:
It could be refactored to allow a custom rg command to execute the
Invoke-PsFzfRipgrep
cmdlet.In the example above the custom variable would be
$env:PSFZF_RG_PREFIX
but the name is just an example.