OhMyPosh来美化GitBash

本文指导读者如何在Windows系统上下载并配置Git,以及安装和配置OhMyPosh,包括设置环境变量、安装字体,以及如何将OhMyPosh主题添加到~/.bash_profile或~/.bashrc中以个性化终端。
摘要由CSDN通过智能技术生成

1.下载git(Git)

 2. 下载oh-my-posh(Windows | Oh My Posh)

 2.1安装

winget install JanDeDobbeleer.OhMyPosh -s winget

2.2配置环境变量

$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"

2.3下载字体

oh-my-posh font install

 确保将您的终端配置为使用您已安装的字体

2.4追加到~/.bash_profile(windows下)

添加以下内容~/.bashrc(可能是~/.profile~/.bash_profile取决于您的环境)

文件路径需要参考下图

其中json文件是不同主题,参考官网(Themes | Oh My Posh)

 eval "$(oh-my-posh --init --shell bash --config ~/montys.omp.json)"

比如这里我的就是

eval "$(oh-my-posh --init --shell bash --config ~/AppData/Local/Programs/oh-my-posh/themes/1_shell.omp.json)"

添加后,重新加载您的个人资料以使更改生效。 

exec bash
source ~/.bash_profile

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值