powershell自动补全

Ethereal Lv4

1. 执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Install-Module PSReadLine -RequiredVersion 2.1.0

Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History

Test-path $profile

# 如果是False执行下面
# New-item –type file –force $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

参考

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

  • Title: powershell自动补全
  • Author: Ethereal
  • Created at: 2025-03-20 12:52:43
  • Updated at: 2025-03-20 12:55:32
  • Link: https://ethereal-o.github.io/2025/03/20/powershell自动补全/
  • License: This work is licensed under CC BY-NC-SA 4.0.
 Comments
On this page
powershell自动补全