官方教程
一. Windows PowerShell美化
-
安装系统字体:Nerd Font
- 下载地址
- 解压后,右键点击ttf文件,选择“安装”。
- 打开 “终端-设置-PowerShell-外观-字体:选择下载的字体xxx Nerd Font”。
-
安装Oh My Posh
- 安装命令:
winget install oh-my-posh - 选择Microsoft Store版本:
winget install XP8K0HKJFRXGCK - 查看是否安装成功:
oh-my-posh version
- 安装命令:
-
选择并应用主题
- 修改配置文件:
notepad $PROFILE - 在打开的编辑器内输入:
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\aliens.omp.json" | Invoke-Expression 可选择自己喜欢的[主题](https://ohmyposh.dev/docs/themes#agnosterminimal),替换上面的 "aliens"
- 修改配置文件:
二. WSL美化
-
安装Homebrew for Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
~/.profile 配置文件加上。
# ps:好像配不配无所谓 test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile # 配置主题 eval "$(oh-my-posh init bash --config /mnt/c/Users/"hf"/AppData/Local/Programs/oh-my-posh/themes/aliens.omp.json)" 可选择自己喜欢的[主题](https://ohmyposh.dev/docs/themes#agnosterminimal),替换上面的 "aliens" -
安装oh-my-posh。教程里安装是jandedobbeleer/oh-my-posh/,但是不成功。
brew install oh-my-posh