安装git
首先先下载 git 并进行安装
Git – Downloading Package (git-scm.com)
设置WindowsTerminal启动GitBash
在windows的terminal中增肌git bash 的配置,并设置为启动
- 进入windows termial 的设置
- 添加新配置
- 新建空的配置文件
- 选择执行文件是:C:\Program Files\Git\bin\bash.exe
- 名称改为:GitBash
- 回到启动 ,选择新的 GitBash配置
- 这样点击+号打开的终端,就是 git bash 了
下载并配置zsh
下载 windows 版本的zsh ,地址如下
下载的zsh是压缩格式,使用 https://peazip.github.io/ 进行解压
PeaZip free archiver utility, open extract RAR TAR ZIP files
解压之后,将文件夹 etc 和 usr 复制到 git 的安装地址:
C:\Program Files\Git
这样在git bash 终端里面就可以执行 zsh命令
配置 zsh 为git bash 的默认终端
编辑 ~/.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)"
安装几个常用的插件
zsh-syntax-highlighting/INSTALL.md at master · zsh-users/zsh-syntax-highlighting · GitHub
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
zsh-autosuggestions/INSTALL.md at master · zsh-users/zsh-autosuggestions · GitHub
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions