windows powershell安装oh-my-posh提示

  1. 官网教程: https://ohmyposh.dev/docs/installation/windows

安装

使用winget/scoop/手动安装oh-my-posh
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

设置windows defender扫描排除项

win10 : windows安全中心-病毒和威胁防护-病毒和威胁防护设置-添加和删除排除项-添加文件-选择安装oh-my-posh位置的exe文件

oh-my-posh安装位置

执行:(Get-Command oh-my-posh).Source可以获取安装位置

字体安装

如果不安装字体会有乱码: https://ohmyposh.dev/docs/installation/fonts, 下载完成后在你使用的终端里配置使用安装的字体

配置初始化

https://ohmyposh.dev/docs/installation/prompt
notepad $PROFILE
编辑文件, 添加下列配置:
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
你可以在安装位置看主题文件夹选择自己喜欢主题, 替换config中的名称。
. $PROFILE 应用配置

Get-PoshThemes 查看喜欢的主题

posted @ 2022-08-23 11:31  cnheat  阅读(432)  评论(0)    收藏  举报