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

相关推荐
Superstarimage2 小时前
使用conda创建python虚拟环境,并自定义路径
windows·python·conda
Evaporator Core7 小时前
深入探索:Core Web Vitals 进阶优化与新兴指标
前端·windows
Mcworld8578 小时前
java集合
java·开发语言·windows
hnlucky9 小时前
windows编写和调试代码工具——IDE安装
ide·windows
大强同学10 小时前
Adobe DC 2025安装教程
windows·adobe·pdf
python15611 小时前
使用Langfuse和RAGAS,搭建高可靠RAG应用
人工智能·windows·python
QQ_43766431411 小时前
单向循环链表C语言实现实现(全)
数据结构·windows·链表
CodeBlossom11 小时前
java加强 -stream流
java·windows·python
humors22113 小时前
Windows运维工具批处理版
运维·windows·计算机·电脑·笔记本·维护·台式机
hnlucky14 小时前
Windows 上安装下载并配置 Apache Maven
java·hadoop·windows·学习·maven·apache