Blazing fast tab completion for powershell and pwsh.
This video is using the MenuComplete
binding in code $PROFILE
:
powershell
Set-PSReadLineKeyHandler -Key Tab MenuComplete
Features:
* Fast startup and execution using nushell/nu-engine
* Extendable using .nu
files, with built in support for commmon tasks like git
and npm run
* Supports all platforms. Tested on windows, WSL, mac and linux
By default, completions.nu is used. An alternative .nu
file can be specified in the TABCOMPLETE_FILE
environment variable.
There are binaries available in releases, or with one of these commands:
| Repository | Instructions |
| --------------- | ----------------------------------------- |
| [crates.io] | cargo install posh-tabcomplete --locked
|
Add this line to your profile, you can edit this by typing code $PROFILE
in powershell:
pwsh
Invoke-Expression (&posh-tabcomplete init | Out-String)
The completions packaged with the binary in completions.nu are: * git completions. These are also combined with git auto generated completions * npm completions * cargo completions
To run these, run ./benchmark/benchmark_all.ps1
| Benchmark | Results |
| ---------------------------------------------------- | ------------------------------------------------------- |
| benchmark/init
- startup time | posh-tabcomplete: 102ms, posh-git: 432ms (4.24x faster) |
| benchmark/complete
- tab completion (100 branches) | posh-tabcomplete: 71ms, posh-git: 172ms (2.42x faster) |
Functions are supported. For example, the completion of gco
in the demo is:
pwsh
function gco() { git checkout $args }
There is no support for alias completions at this time.
See completions.nu:
git
branch
checkout
cherry-pick
fetch
merge
push
rebase
switch
npm
run