[LINUX] 在 Win10 上搭建好用的终端开发环境:windows terminal + git bash + zsh + oh-my-zsh



1、安装 Windows Terminal

Microsoft Store,或从 Windows 开始菜单中启动 Microsoft Store 应用程序并搜索 Terminal

注意: 注意不要选择早期的 Windows Terminal Preview 应用程序。

注意: 其对 windows 版本有要求,需要更新系统(更新系统卡死在 99%,需要参考参考链接2;有些浏览器连易升都下载不了,建议用 google 浏览器)


2、安装 git for windows

下载地址:https://gitforwindows.org,下载好之后,全部采用默认安装。


3、设置 Windows Terminal

  • 启动 Windows Terminal,点击设置

  • 添加新配置文件->新增新配置->别忘了保存

  • 设置->选择默认为 git bash


4、安装 zsh

  • MSYS2 网站可以下载到最新的 zsh 安装包:zsh-5.8-5-x86_64.pkg.tar.zst

  • 由于下载的是 zst 后缀文件,Windows 上需要安装 PeaZip 工具(下载8.30以上版本)

  • 下载完成后解压再解压,可以看到文件如下:

  • 将这些文件直接解压到 Git 的安装目录下,与之前的文件进行合并,可以理解为把 zsh 当作 git bash 的一个补充安装包:

  • 此时我们打开 git bash,敲下 zsh,就会看到我们已经成功


5、安装 Oh my zsh

在 zsh 里执行(curl)

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 或者 
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

或者用 wget

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

最后,用 VIM 编辑 ~/.bashrc 文件,在其最后加入 zsh,表示终端打开默认执行 zsh。


参考链接

[1]. Windows Terminal完整指南
[2]. Windows 10更新失败在百分99处卡住的处理方法
[3]. Install Terminal + git-bash + zsh + oh-my-zsh on Windows 10



: 陆续更新中...

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章