Reputation: 21532
I want to be able to invoke fzf
in Powershell with Ctrl+T and it should use ripgrep
so it's faster.
I don't know what to set up in PowerShell_profile.ps1
to achieve the above goal.
Every time I make a search with Ctrl+T, the file search starts anew which takes time, instead of using some kind of cache:
The Internet suggests to make fzf
use ripgrep
My current Powershell_profile_ps1 file looks like this
# PSReadLine
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineKeyHandler -Key Tab -Function Complete
# PSfzf
Import-Module PSFzf
# Override PSReadLine's history search
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' `
-PSReadlineChordReverseHistory 'Ctrl+r'
# Override default tab completion
Set-PSReadLineKeyHandler -Key Tab -ScriptBlock { Invoke-FzfTabCompletion }
Some blogs suggest to put this line in PowerShell_profile.ps1
:
$env:FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
But I didn't notice any improvements even after restarting the Windows Terminal.
Upvotes: 0
Views: 683