windows美化终端

mac osoh-my-zsh + itrem2,做终端美化;windows 也有对应的解决方案,即 oh-my-posh + Conemu

1. 安装Oh My Posh

oh-my-posh 官网:https://ohmyposh.dev/;

1. winget 切换国内源
shell 复制代码
# 删除由 Microsoft 维护的官方源
winget source remove winget

# 添加中科大开源软件镜像源
winget source add winget https://mirrors.ustc.edu.cn/winget-source

# 换源完成后,可以通过以下命令进行验证和查看
winget source list

# 如果要恢复使用 Microsoft 官方源,可以使用以下命令进行重置
winget source reset winget
2. 安装 Oh My Posh
shell 复制代码
winget install JanDeDobbeleer.OhMyPosh -s winget
3. 安装Nerd Fonts字体

Nerd Fooonts 字体官网:https://www.nerdfonts.com/font-downloads

注:Oh My Posh使用的主题存在一些特殊字体,所以需要专门下载字体支持显示,否则会出现乱码

4. 安装 Oh My Posh 插件
shell 复制代码
# 给目录加颜色
Install-Module DirColors
# Git插件
Install-Module posh-git -Scope CurrentUser
# 给目录加图标
Install-Module -Name Terminal-Icons -Repository PSGallery

# 自动补全, 不建议安装,没有必要
Install-Module -Name PSReadLine -Scope CurrentUser -Force
5. 配置配置文件

使用命令打开配置文件:

shell 复制代码
notepad $Profile

oh-my-posh 主题存储在 C:\Users\用户名\AppData\Local\Programs\oh-my-posh\themes\ ,里面的 json 文件即为主题文件,自己选择一个即可,主题浏览页面如下:https://ohmyposh.dev/docs/themes

编辑文件内容,并保存:

复制代码
oh-my-posh init pwsh --config "C:\Users\wanghoukun\AppData\Local\Programs\oh-my-posh\themes\gruvbox.omp.json"  |  Invoke-Expression

Import-Module posh-git
Import-Module DirColors
Import-Module -Name Terminal-Icons
# Import-Module PSReadLine
6. 安装 Conemu
  1. 配置 启动任务Shell::powerShell
  2. 配置字体为 Nerd Fonts 字体

参考:https://blog.csdn.net/qq_44625774/article/details/140237194

https://post.smzdm.com/p/a5k6e033/

https://dev.net.cn/276.html

相关推荐
巴拉巴拉~~1 天前
Flutter 通用轮播图组件 BannerWidget:自动播放 + 指示器 + 全场景适配
windows·flutter·microsoft
双河子思1 天前
Windows API 积累
windows
OliverH-yishuihan1 天前
在 Windows 上安装 Linux
linux·运维·windows
淼淼7631 天前
工厂方法模式
开发语言·c++·windows·qt·工厂方法模式
ForteScarlet1 天前
如何解决 Kotlin/Native 在 Windows 下 main 函数的 args 乱码?
开发语言·windows·kotlin
WTCLLB1 天前
Windows命令和工具名称
windows
YCOSA20251 天前
雨晨 Windows 11 企业版 26H1 轻装版 28020.1362
windows
陈陈爱java1 天前
Conda 常用命令行
linux·windows·conda
狮智先生1 天前
【编程实践】Windows + PySide6 + Matplotlib 绘图时 WinError 32 的完整排查与解决方案
windows·ui·个人开发·matplotlib·交通物流
czhc11400756631 天前
c# 1216
windows·microsoft·c#