Advertisement
Pandaaaa906

Untitled

Nov 11th, 2022
1,521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 主题插件
  2. Import-Module posh-git
  3.  
  4. # 设置主题
  5. oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\powerlevel10k_rainbow.omp.json" | Invoke-Expression
  6.  
  7. # 设置别名, py命令, 打开ptipython, 需要装ptipython, pip install ptpython ipython
  8. Set-Alias -Name py -Value ptipython
  9.  
  10. # 命令历史回溯
  11. Import-Module PSReadLine
  12. Set-PSReadLineOption -PredictionSource History
  13.  
  14. Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward  # 上箭头选上一个历史命令
  15. Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward  # 下箭头选下一个历史命令
  16. Set-PSReadLineKeyHandler -Key "Ctrl+RightArrow" -Function ForwardWord  # Ctrl+RightArrow一个个单词往右自动填充
  17. Set-PSReadLineKeyHandler -Key "Ctrl+f" -Function ForwardWord  # 跟上边一样的
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement