oh-my-posh配置

文件配置

自用文件配置 notepad $PROFILE

oh-my-posh init pwsh | Invoke-Expression
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\ys.omp.json" | Invoke-Expression
# 自动补全
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows

日常使用

可以装一个chocolaty,类似于Ubuntu的apt,参考https://docs.chocolatey.org/en-us/choco/setup

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

然后可以把vim之类的也装上

choco install vim

如果要更新环境变量的话用 . $PROFILE

问题

遇到了这样的问题
Get-PSReadLineKeyHandler : 找不到与参数名称“Key”匹配的参数。

根据https://github.com/JanDeDobbeleer/oh-my-posh/issues/3136#issuecomment-1328544012提示,可以参考https://github.com/PowerShell/PSReadLine#install-from-powershellgallery-preferred升级PSReadLine

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值