This is an experimental PSReadLine predictor using zoxide results to show you what folder you are about to cd into - before you press enter.
Note: This module currently has the zoxide command fixed to
cd
.You can set the zoxide alias to
cd
by replacing thezoxide init
line in your$PROFILE
with thisInvoke-Expression (& { (zoxide init powershell --cmd cd | Out-String) })
- Every 60 seconds a background thread activates which will run
zoxide query --list --all --score
and parses the result into a dictionary. - Does nothing until you type
cd
just like you would with zoxide. - This module then sends prediction results using a C# Reimplementation of the zoxide algorithm to the shell to show up as suggestions
zoxide
- PowerShell Core
dotnet
version 9.xPsReadLine
version 2.1.0 or later (Update usingUpdate-Module
)
- Clone this repo
- Enter the Subdirectory
ZoxidePredictor
- Run (best in PowerShell):
# non-Windows dotnet publish -c Release -o $HOME/.local/share/powershell/Modules/ZoxidePredictor # Windows dotnet publish -c Release -o $HOME\Documents\PowerShell\Modules\ZoxidePredictor
- Add the following to your
$PROFILE
:Import-Module ZoxidePredictor
- Restart powershell and verify that the provider has been registered by running
Get-PSSubsystem -Kind CommandPredictor
, which should havezoxide
underImplementations
Press <F2>
to switch between inline and list. (I personally prefer list).
To permanently change to list by default, add the following line to your $PROFILE
:
Set-PSReadLineOption -PredictionViewStyle ListView
(You may also need to add Import-Module PSReadLine
at the top. On some systems I need it, on others not.)