DEV Community

Cover image for Install Oh my ZSH on Windows without WSL
Ajinkya Borade
Ajinkya Borade

Posted on • Updated on

Install Oh my ZSH on Windows without WSL

This is going to a really simple post on Installing ZSH on Windows.
And I'm going to assume you already have Windows Terminal Installed, along with Git SCM

But for some reason I feel GitBash + ZSH seems to be really smooth experience on installing plugins. Specially the auto spelling corrections :P

Preview

Windows Oh my zsh via posh

Start here :

Download Latest ZSH tar file

https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64

Optional Install PeaZip on Windows (to open TAR file)

https://peazip.github.io/
winget install -e --id GiorgioTani.PeaZip

CD to C:\Program Files\Git

extract tar file contect

  • extract all contents of zsh ..tar file to this folder

Now open GIT Bash CD to C:\Program Files\Git and type: zsh
Git bash via Terminal

  • in side terminal type: zsh

ZSH in git bash

Create config files

autoload -U zsh-newuser-install
zsh-newuser-install -f
Enter fullscreen mode Exit fullscreen mode

Finally open notepad ~/.bashrc

  • Add to the top of the file
if [ -t 1 ]; then
  exec zsh
fi
Enter fullscreen mode Exit fullscreen mode

Install Plugins

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode
  • Now open notepad ~/.zshrc
  • And Add plugins under this section # Which plugins would you like to load?
plugins=(git lighthouse zsh-completions zsh-autosuggestions zsh-syntax-highlighting)
Enter fullscreen mode Exit fullscreen mode

Windows ZSH

ps. You can even use Oh-my-posh with Terminal 7.xx + on windows.
Powershell 7

Top comments (3)

Collapse
 
sso profile image
Sall

Nice! I am wondering, how compatible ZI would be, as it would give developers huge freedom. Technically it should work, however it may require some adjustments. I would help ti make i happen. 🧙‍‍♀️ 💫

Collapse
 
ajinkyax profile image
Ajinkya Borade

Hi, I went through the installation, it looks possible. But I quite didnt understand its real use.

Collapse
 
sso profile image
Sall

It can install anything from anythere, and setup terminal (Zsh) whatever you like it is not framework specific and can do same as all other plugin managers all together. Yoy can as ‘tiny OS’ or as package manager for your system it limited to Zsh scripting language capabilities and Zsh is very powerful scripting language specifically for interactive usage. Alsi it will update, measure, test, compare or whatever whatever you will set it todo, like setting up 50 different themes/prompts which enables automatically based in conditions like: current location , OS or whatever other varable you set. Reading Wiki would give better idea. However I am unsure how compatible it is with Windows, also has fixes related ti other shell language (more in wiki) and Zsh pretty well emulates them as far as I tried. Hope Gave an Idea ;)