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

相关推荐
C++ 老炮儿的技术栈3 小时前
UDP 与 TCP 的区别是什么?
开发语言·c++·windows·算法·visual studio
夏日米米茶9 小时前
Windows系统下npm报错node-gyp configure got “gyp ERR“解决方法
前端·windows·npm
虾球xz11 小时前
CppCon 2015 学习:CLANG/C2 for Windows
开发语言·c++·windows·学习
码上库利南11 小时前
Windows开机自动启动中间件
windows
nenchoumi311917 小时前
AirSim/Cosys-AirSim 游戏开发(一)XBox 手柄 Windows + python 连接与读取
windows·python·xbox
love530love19 小时前
【PyCharm必会基础】正确移除解释器及虚拟环境(以 Poetry 为例 )
开发语言·ide·windows·笔记·python·pycharm
黄交大彭于晏20 小时前
发送文件脚本源码版本
java·linux·windows
vfvfb1 天前
bat批量去掉本文件夹中的文件扩展名
服务器·windows·批处理·删除扩展名·bat技巧
我命由我123452 天前
VSCode - VSCode 放大与缩小代码
前端·ide·windows·vscode·前端框架·编辑器·软件工具
PT_silver2 天前
tryhackme——Abusing Windows Internals(进程注入)
windows·microsoft