oh-my-posh
1.PowerShell,让终端更好用
作为一名开发者,是不是经常羡慕MacOS和Linux上那些花里胡哨的终端?😍 Windows下的cmd.exe是不是看着很挫?但是你知道吗,Windows其实也自带了一个强大的Shell - PowerShell!🚀
PowerShell不仅命令行功能比cmd全面,还能直接调用.NET框架,脚本编写也很方便。可惜就是界面简陋了点,不够酷炫。🥺 但是别急,本文将手把手教你美化PowerShell,让它焕然一新!
2. 安装oh-my-posh
oh-my-posh官网: https://ohmyposh.dev/docs/installation/windows
在PowerShell中运行以下命令安装Oh-my-posh:
scoop install oh-my-posh
我现在需要打开powershell 输入以下命令, 如果报错可能是计算机上没有创建好该文件,可以自行创建
notepad $PROFILE
用记事本输入以下命令,themes
是oh-my-post 存放主题的配置
D:/Scoop/apps/oh-my-posh/current/oh-my-posh.exe
安装的oh-my-posh位置D:/Scoop/apps/oh-my-posh/current/themes/<font style="color:#DF2A3F;">M365Princess.omp.json</font>
主题名
# 导入oh-my-posh 并且应用agnosterplus主题
D:/Scoop/apps/oh-my-posh/current/oh-my-posh.exe init pwsh --config D:/Scoop/apps/oh-my-posh/current/themes/M365Princess.omp.json | Invoke-Expression
配置好重新打开powershell即可
3. 安装Nerd字体
你可能会看到主题里有一些方框,那是因为缺少支持Powerline的字体,可以安装Nerd字体来解决。
scoop bucket add nerd-fonts
scoop install Hack-NF
重启终端,然后打开设置
选择其他设置
里的外观
选择Hack Nerd Front 字体
保存,重启终端即可
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步