软件支持
下载软件
cd ~/Download
winget install Microsoft.WindowsTerminal
winget install Git.Git
winget install mcmilk.7zip-zstd
curl -LO https://mirror.msys2.org/msys/x86_64/zsh-5.9-2-x86_64.pkg.tar.zst
curl -LO https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.0-RC/Meslo.zip
- 打开终端>设置>添加新配置文件>新建空配置文件>保存
名称:Git Bash
命令行:"C:\Program Files\Git\bin\bash" --cd-to-home
启动目录:%USERPROFILE%
图标:%SystemDrive%\Program Files\Git\mingw64\share\git\git-for-windows.ico
- 右击文件 zsh-5.9-2-x86_64.pkg.tar.zst 使用 7-zip ZS 解压到当前文件,使用管理员权限打开 7-zip 解压文件 zsh-5.9-2-x86_64.pkg.tar 解压到 C:\Program Files\Git 目录并且选择不覆盖文件。
- 解压 Meslo.zip => Meslo 全选字体文件,为所有用户安装。
- 打开终端 > 选择 Git Bash 标签 > 输入命令
zsh
autoload -U zsh-newuser-install
zsh-newuser-install -f
- 编辑配置文件 ~/.bashrc 并保存
if [ -t 1 ]; then
exec zsh
fi
- 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- 安装 oh-my-posh
winget install JanDeDobbeleer.OhMyPosh -s winget
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"
oh-my-posh get shell
echo 'eval "$(oh-my-posh init zsh)"' >> ~/.zshrc
- 设置字体:打开终端>设置>Git Bash>外观>字体>MesloLGL NF
资料
- github.com/microsoft/t…
- github.com/JanDeDobbel…
- github.com/mcmilk/7-Zi…
- github.com/ryanoasis/n…
- git-scm.com/
- dominikrys.com/posts/zsh-i…