lcdsmao

How to install oh-my-zsh in cygwin

image

  1. Install cygwin.

Download cygwin installer then execute:

bash
./setup-x86_64.exe -q -P git,vim,curl,wget,zsh,chere
  1. Install oh-my-zsh.
bash
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  1. Make zsh as the default shell.

Add following line to the top of ~/.bashrc:

bash
exec zsh
  1. (Optional) Add cygwin to right-click context menu.

Run cygwin as administrator and execute:

bash
chere -i -t mintty -s bash
  1. (Optional) Use cygwin as integrated terminal in IDE (IDEA, VS Code, etc.).

Create a bat file named Cygwin-integrated.bat under C:\cygwin64 with following content:

bat
@echo off
set CHERE_INVOKING=1
C:\cygwin64\bin\bash.exe --login -i

Make it executable:

bash
chmod +x Cygwin-integrated.bat

Edit VS Code user settings (other IDEs are similar):

text
"terminal.integrated.shell.windows": "C:\\cygwin64\\Cygwin-integrated.bat"`
cygwinzsh
© 2020 lcdsmao