Last active
August 27, 2024 15:34
-
-
Save rich1e/a6f79276fe59abcc1c57a93028b2eb36 to your computer and use it in GitHub Desktop.
PowerShell Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module posh-git | |
| Import-Module posh-sshell | |
| Start-SshAgent | |
| Import-Module oh-my-posh | |
| Set-PoshPrompt -Theme ys | |
| Import-Module yarn-completion | |
| Import-Module npm-completion | |
| Import-Module posh-docker | |
| # 引入 PSReadLine | |
| Import-Module PSReadLine | |
| # 设置历史记录 | |
| Set-PSReadLineOption -HistorySearchCursorMovesToEnd | |
| Set-PSReadLineOption -PredictionSource History | |
| # 下面三条是文档里推荐的 | |
| Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward | |
| Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward | |
| # 菜单命令补全 | |
| Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete | |
| # vi 模式 | |
| Set-PSReadlineOption -EditMode Vi | |
| Set-PSReadlineOption -ViModeIndicator Cursor | |
| # 彩色的 ls ,代替 dir | |
| If (-Not (Test-Path Variable:PSise)) { | |
| Import-Module Get-ChildItemColor | |
| Set-Alias l Get-ChildItemColor -option AllScope | |
| Set-Alias ls Get-ChildItemColorFormatWide -option AllScope | |
| } | |
| Invoke-Expression (& { (zoxide init powershell | Out-String) }) | |
| Invoke-Expression (&scoop-search --hook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment