安装Scoop
PSCompletions (psc) 是什么?1
PSCompletions 是一个补全管理器,为 PowerShell 带来更出色、更简便的 Tab 补全体验,基于 Rust + Lua 构建。
PSCompletions (psc) 安装配置与使用2
使用 abyss bucket (GitHub 或 Gitee)
添加 bucket,([GitHub](https://github.com/abgox/abyss) 或 [Gitee](https://gitee.com/abgox/abyss)) 根据网络情况任选其一。
scoop bucket add abyss https://github.com/abgox/abyss
scoop bucket add abyss https://gitee.com/abgox/abyss
安装 PSCompletions
scoop install abyss/abgox.PSCompletions配置 PowerShell Profile3
New-Item -ItemType Directory -Path "$env:USERPROFILE\Documents\WindowsPowerShell" -Force
New-Item -ItemType File -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -Force
notepad "$env:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"这会在 ~/Documents 里创建一个文件夹 WindowsPowerShell,并且在这个文件夹下创建 Microsoft.PowerShell_profile.ps1 文件。
然后在打开的文件中写入:
# 导入自动补全
Import-Module PSCompletions
之后重启终端,然后可以尝试添加 git 和 scoop 的命令补全:
psc add git scoop