Mobile wallpaper 1Mobile wallpaper 2Mobile wallpaper 3Mobile wallpaper 4Mobile wallpaper 5Mobile wallpaper 6Mobile wallpaper 7Mobile wallpaper 8
186 字
1 分钟
Windows和Linux的终端美化

如何安装Oh-My-Posh和Oh-My-Zsh#

在Windows安装oh-my-posh#

  1. 安装oh-my-posh
Terminal window
winget install JanDeDobbeleer.OhMyPosh --source winget
# 修改执行策略
set-ExecutionPolicy RemoteSigned
# 查看软件路径
(Get-Command oh-my-posh).Source
# 把软件路径bin目录添加到PATH
$env:Path += ";[软件路径/bin]"
  1. 创建配置文件
Terminal window
# 查看文件是否存在
Test-Path $PROFILE
# 创建
New-Item -Path $PROFILE -Type File -Force
# 初始化
oh-my-posh init pwsh | Invoke-Expression
notepad $PROFILE
# 添加内容, themeName是主题文件名
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/{themeName}.omp.json" | Invoke-Expression
  1. 下载字体 MesloLg Nerd Font

  2. 查看所有主题

Terminal window
get-Poshthemes

在Fedora安装oh-my-zsh#

  1. 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. 安装字体
sudo dnf install powerline-fonts
  1. 修改默认终端为/bin/zsh

下载主题

  1. 编辑配置文件
# 查看主题文件夹
ls ~/.oh-my-zsh/themes
# 更换主题文件 修改 ZSH_THEME
nano ~/.zshrc
Windows和Linux的终端美化
https://www.mikuas.top/posts/installohmy_zsh_posh/
作者
Mikuas
发布于
2025-01-12
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时