配置oh-my-posh

本文详细指导如何在WindowsPowerShell中安装和配置Oh-My-Posh,设置主题,解决乱码问题,包括使用NerdFonts和MesloNerdFont。同时介绍了如何在VSCode终端中调整字体配置。
摘要由CSDN通过智能技术生成

在windows上的powershell上配置oh-my-posh,使其更像在linux用oh-my-zsh

  • 首先打开powershell,输入:
winget install JanDeDobbeleer.OhMyPosh -s winget

安装on-my-posh.exeoh-my-posh上最新的主题。

之后重启powershell

  • 打开配置文件
# 如果之前没有配置文件,就新建一个 PowerShell 配置文件
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
# 用记事本打开配置文件
notepad $PROFILE
Import-Module posh-git 
Import-Module oh-my-posh
# 设置主题为Agnoster
Set-PoshPrompt Agnoster

之后重启即可。

在这里插入图片描述

由于windows缺少一些支持的字体,所以看见的是乱码的情况。

Nerd Fonts - Iconic font aggregator, glyphs/icons collection, & fonts patcher上找字体进行下载。

推荐使用Meslo Nerd Font

在这里插入图片描述

在这里插入图片描述

下载完成进行解压后,打开目录:全选进行字体安装

在这里插入图片描述

在终端默认值中进行设置:

在这里插入图片描述

之后就配置好了。

在这里插入图片描述

vscode终端中配置,打开setting.json,进行设置

    "terminal.integrated.fontFamily": "MesloLGM Nerd Font",

在这里插入图片描述

在这里插入图片描述

待解决

windows10默认的powershell字体选项中没有Meslo Nerd Font,仍然乱码。

在这里插入图片描述

5 个 PowerShell 主题,让你的 Windows 终端更好看 - 少数派 (sspai.com)

Windows Terminal 快速配置 oh-my-posh_windows 设备oh-my-posh字体-CSDN博客

Fonts | Oh My Posh

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

golemon.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值