WindowsTerminal安装posh-git

   
摘要GPT
摘要小助理暂时失联跑路啦……😜
set-executionpolicy remotesigned

安装:PSReadLine

Install-Module PSReadLine -RequiredVersion 2.1.0

安装posh-git

PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force

写入配置:

notepad $PROFILE

若提示错误:请继续以下代码

New-Item -Path $PROFILE -Type File -Force

Microsoft.PowerShell_profile.ps1 配置:

clear
# Tab 当按Tab键时,显示所有选项的导航菜单
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
 
# 每次回溯输入历史,光标定位于输入内
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
 
# 下一条自动补全 History记录 line模式中相反
Set-PSReadlineKeyHandler -Key Ctrl+n -Function HistorySearchForward
# 上一条自动补全 History记录
Set-PSReadlineKeyHandler -Key Ctrl+p -Function HistorySearchBackward
 
# auto suggestions
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History


 # git自动补全
#Add-PoshGitToProfile
Import-Module posh-git
知识共享许可证 CC BY-NC-SA 4.0
最后更新于 2024-07-17 18:28
使用 Hugo 构建
主题 hugo-magic小洋葱 魔改 由 Jimmy 设计
Written by Human, Not by AI