ZSH style autocomplete in PowerShell with PSReadline
I went looking for a way to get ZSH style AutoComplete where it shows commands from youor history as you type and you can complete with a tap of the right arrow. And I came a cross PSReadline, a powerful PowerSHell model that does autocomplete exactly how I wanted it and so much more. I am using it mostly for the autocomplete functionality but if you have a read through it’s default profile, there are some great additional things it can do. To the installation and set up. First you need to ensure you Execution Policy is set to remote signed, so from an Administrative PowerShell:
Then you need to install the module with:
Then we need to add some lines to your profile file (.ps1 file) should be in your ~/Documents/PowerShell
folder by default:
By default this will pull history from the default location, which you can find by Get-PSReadlineOption
, normally located at %USERPROFILE%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine
.