合作联系微信: w6668263      合作联系电话:177-9238-7426     

Windows Terminal/Powershell 设置自动补全, 智能提示 【类似于mac的iterm2功能】

Windows Terminal/Powershell 设置自动补全, 智能提示

 

安装:´PSReadLine´ version 2.1.0

 

# 安装:´PSReadLine´ version 2.1.0
Install-Module PSReadLine -RequiredVersion 2.1.0


# 初始化:
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History

 

 # 检测是否有配置好文件

Test-path $profile

# 如果返回是‘false’ 执行下面:

New-item –type file –force $profile

# 如果返回是ture,或者上一步创建好,直接下一步

 

 

# 编辑profile配置文件:

notepad $profile

 

# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

# Autocompletion for arrow keys
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward

# auto suggestions
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History

# 保存之后,退出。

 

 

以上内容自己整理 参考自: https://blog.csdn.net/weixin_42081389/article/details/124392018 

posted on 2025-01-21 14:47  草率的龙果果  阅读(675)  评论(0)    收藏  举报

导航