DEV Community

Cover image for How to Install Oh My Zsh! on Windows 10 Home Edition

How to Install Oh My Zsh! on Windows 10 Home Edition

Vinícius Albuquerque on June 20, 2020

As a developer, some tools may be a game changer for your productivity, but sometimes we just need to work in an environment that makes things easi...
Collapse
 
sahansj34 profile image
sahansj34

Hi there thanks so much for the tutorial.

However im stuck at trying to installing nvm. after the source ~/.zshrc execution i get a

/home/sj/.zshrc:101: command not found: Set

I seem to have followed the earlier steps properly and I do not know why.

Please help...

Collapse
 
borsemayur2 profile image
Mayur Borse

I removed the Set part of the command. It worked for me.

Collapse
 
randlelanre profile image
Randle Kehinde Olanrewaju

I am also getting the same error as you, can someone please shed light on this

Collapse
 
pandahutmiku profile image
Miku

The set command is case-sensitive. Just change "Set" to "set"

Thread Thread
 
omarkhangithub profile image
Omar Khan

This works!! Thanks @pandahutmiku
I just changed
Set ZSH_THEME="spaceship" (in .zshrc) TO
set ZSH_THEME="spaceship"

WORKING PERFECTLY!

Collapse
 
cleancodestudio profile image
Clean Code Studio

AMAZING article sir, huge thank you to the immense amount of detail and effort put into setting up an amazing terminal workflow within windows.

I've been on mac/linux for the past few years and recently had to switch back to windows for a new gig. This terminal set up will help the workflow tremendously, thank you!

This article just made life and my personal workflow MUCH more enjoyable. Thank you!

Collapse
 
vsalbuq profile image
Vinícius Albuquerque

I'm really happy to read that, Zak! Thank you very much for sharing it!

Collapse
 
cleancodestudio profile image
Clean Code Studio

Absolutely it deserves to be shared. I owe you a huge thank you, even just a week after reading this article I've taken a descent deep dive into electron as a whole. I've always known it's out there, but justified not deep diving into a rabbit whole.

I was shared this article on my youtube channel and at work. Then, perfectly timed, I actually ran into some problems with a small app I'm building that electron solved perfectly and quickly.

After working with in a minor way on an application, I was fanboying over electron to the lead software developer at my company. Two days later we were talking about it again and I was showing him my personal electron project.

Now, as I did a week earlier, he's coming to understand the incredible power behind Electron as well and we've been full geek out on the possibilities it has for our company. Nothing is for sure as of yet, but out of the blue he said "I can't wait to have you start building out our internal electron project to see what you can do with it."

It's an amazing company and they focus a ton on high quality talent, hiring less than 3% of applicants.

This week is only my third week, and although not a forsure thing, this article may have lead to an incredible opportunity early on a place stacked plum to the brim with talent and other needs.

Thank you for this share, I'll be checking in to see any new posts you create :)

Thread Thread
 
vsalbuq profile image
Vinícius Albuquerque

Wow, Zak... That is amazing! Very happy to help!

Collapse
 
nivnahmias profile image
Niv Nahmias • Edited

Thanks for the great guide.

I'm having some issues setting the default shell for hyper to ubuntu.
My ubuntu shell is located at:
C:\Users\Niv\AppData\Local\Microsoft\WindowsApps\ubuntu2004.exe

I can verify this path is correct by running it.
I also tried setting the shell property to 'C:\Windows\System32\wsl.exe' as suggested in many other places.
However, setting it as the shell configuration in hyper does nothing. still opens with cmd. (i've made sure to keep shellArgs empty).

Do you have any idea how to fix this?

Collapse
 
vsalbuq profile image
Vinícius Albuquerque

That's weird... What path appears if you run the script bellow?

where ubuntu2004.exe
Enter fullscreen mode Exit fullscreen mode

If this returns a path different from the one you're using, try to use that path instead of the one you're trying to use and let me know if it's working.

Also, your shellArgs array on Hyper's settings must be empty. Have you checked that too?

Collapse
 
nivnahmias profile image
Niv Nahmias

it's the same path as the one i used.
yes, shellArgs are empty.

are you able to set up this guide using this version of ubuntu?

Thread Thread
 
vsalbuq profile image
Vinícius Albuquerque

I'm very busy these past months (couldn't even keep posting here). Sorry...

I hope you find a way to work around the issues you've found. And if you do, please comment the solution here... Maybe someone else will need that answer too.

Collapse
 
pbxed profile image
Jordan Shenolikar

In my case it was a missing comma after copy-pasting from the instructions that was causing hyper to not be able to process the config file. Everything worked on ubuntu2004.exe after spotting this for me.

plugins: [
'hyper-dracula'
], <-----

Collapse
 
nivnahmias profile image
Niv Nahmias

this was exactly my issue, thank you so much.
too bad hyper doesn't output an error when trying to parse this config json

Collapse
 
mauryarohit profile image
mauryarohit

Thanks for the article. Appreciate it so much.
However, if you follow the above mentioned Step 8 your terminal will not open with current workspace folder, to solve this follow these steps instead:

  1. Click Ctrl + Shift + P, search "Terminal: Select Default Profile" and select your Linux distro. Hope this helps too!!
Collapse
 
affanthebest profile image
Siddiqui Affan • Edited

It's still not not opening with current workspace folder

Collapse
 
unlockdep profile image
Dawood Sulaiman Syed

I've encountered an issue. When I run

nvm install --lts

I get an error saying that I don't have it installed even tho I just did the commands all right without errors and I regularly have node installed as I am a we developer.

Collapse
 
vsalbuq profile image
Vinícius Albuquerque

It's kind of difficult to find it out only with the information you gave me...

Have you forgotten the step for adding the path variable to .zshrc, maybe?

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Enter fullscreen mode Exit fullscreen mode

It may be also that you .zshrc wasn't saved before you tried to run nvm.

Also, if you changed the file structure to remove the mnt/, it may cause some issues.

I hope this helps, but I'm really in the dark here, 😅

Collapse
 
joffreydrummond profile image
Joffrey Drummond

I was having the same issue. If you read the prompt after installing nvm from the repo it says you need to close the terminal or run the below script.

I closed and reopened and nvm installed successfully

I hope this helps!

Collapse
 
aldorr profile image
Allan Dorr

Thanks Vinícius, this was very helpful.
One thing I would like to add, is making an alias in ~/.zshrc for VSCodium or VSCode, so you can open files from the command line.
For this I added:

alias code="/mnt/c/Program\ Files/VSCodium/VSCodium.exe"
Enter fullscreen mode Exit fullscreen mode

or you use your path to VS Code, wherever that is. I.e.:

alias code="/mnt/c/Users/{Username}/AppData/Local/Programs/Microsoft\ VS\ Code"
Enter fullscreen mode Exit fullscreen mode

This makes jumping back and forth a little easier.

Collapse
 
rubengmurray profile image
Reece Daniels • Edited

A couple of things I found whilst walking through:

  • Step 1: Needed to run Powershell as Administrator (even though my windows account is an admin)

  • Step 4: Needed git installed before I could run sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

  • Step 7: Re-opening Hyper, I see /home/user/.zshrc:103: command not found: Set at the top of my terminal

  • Step 7: sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" returns a 404

  • Step 8: Adding the "terminal.integrated.shell.windows": "C:\\Users\\<your-user-name>\\AppData\\Local\\Microsoft\\WindowsApps\\debian.exe", into VS code returns the following error (seems to still work though)

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in `#terminal.integrated.profiles.windows#` and setting its profile name as the default in `#terminal.integrated.defaultProfile.windows#`. This will currently take priority over the new profiles settings but that will change in the future.(2)
Enter fullscreen mode Exit fullscreen mode

Step 9: Appreciate the note on version of nvm - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash worked

Step 9: The following was already in my .zshrc after nvm install

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
sim1029 profile image
Simon Schueller

For step 7 You should use this command instead

sh -c "$(curl -fsSL https://git.io/zinit-install)"

Collapse
 
joffreydrummond profile image
Joffrey Drummond

I actually used Terminal, then followed the same steps to add and use Debian in Terminal.
OMG my Terminal is so gorgeous now. I am going to make branches on personal projects just to see the colors lol

One thing that didn't work was nvm install though. I am not sure why and am down a rabbit hole of the internet to figure it out

Thanks for this guide I have been nerding out and telling devs who do not care this morning haha

Collapse
 
reverseroach profile image
Ant

I ended up running "git clone github.com/creationix/nvm.git .nvm" instead, and then "source ~/.nvm/nvm.sh" before "source ~/.zshrc" and it worked for me

Collapse
 
rajdeepmondal1 profile image
Rajdeep Mondal

Hey,
Thanks for your advice, I used github.com/nvm-sh/nvm.git and installed node-v15.14.0 and it worked.

Collapse
 
raman2106 profile image
raman2106

VS code is displaying the following message for step 8:

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in Terminal › Integrated › Profiles: Windows and setting its profile name as the default in Terminal › Integrated › Default Profile: Windows. This will currently take priority over the new profiles settings but that will change in the future.

Help!!

Collapse
 
mauryarohit profile image
mauryarohit

Follow this for Step 8 instead:
Click Ctrl + Shift + P, search "Terminal: Select Default Profile" and select your Linux distro.

Collapse
 
irfan87 profile image
Ahmad Irfan Mohammad Shukri

I am facing this problem. Hope you can help me. I have attached the image to you so I hope you can view it. The problem is in the Hyper, when I list all the directories with ls, all the main folders' background become green. And I would like to fix but I don't have any idea where to fix. I have fixed at the ZSH and Hyper but no positive result.

Collapse
 
vsalbuq profile image
Vinícius Albuquerque

Sorry, I can't see your image and didn't understand what you said. Would you send it again?

Collapse
 
irfan87 profile image
Ahmad Irfan Mohammad Shukri

hahha.. that's okay. I've already fixed it. =)

Thread Thread
 
imtejasvi profile image
im-tejasvi

how did u fix it?

Collapse
 
noahack88 profile image
noahack88

My yarn commands are only working inside the default ~ directory. As soon as I cd out into where my other react apps are I can use the yarn command but it does not work. Also I am a bit confused where the files are on the computer at the beginning of the file path. Help would be appreciated, and I can be more clear if my explanation was not good.

Collapse
 
kyokatarz profile image
Giang Tran • Edited

Hey thanks for instructive guide. I really like it. One thing I wanna ask tho, when I run zsh in VSC (it works), its default path is set to /home/. Adding cwd in VSC config crashes the terminal immediately.

Do you know how to set the zsh default path to project's path on terminal launch?

Collapse
 
outcastdreamer profile image
Saket Savarn • Edited

Hey, thanks for such an amazing article!! This is how my Hyper terminal looks like (dev-to-uploads.s3.amazonaws.com/up...). Different themes but the same tutorial. I am trying to figure out how to add a custom background image with opacity in my terminal. I tried the 'hyper-wallpaper' plugin & this link stackoverflow.com/questions/387953... but don't aren't working for some reason. Can you show me a working example if possible?

Collapse
 
chrislfieldsii profile image
Christopher Fields

This article was a lifesaver for me being able to work on my gaming PC sometimes too. Before this, I just refused to develop on my windows machine unless absolutely necessary but now it is a bit more bearable

Collapse
 
borsemayur2 profile image
Mayur Borse

OMG. I never thought running linux commands (specillay oh-my-zsh) on windows. Thanks for the amazing article. I have followed each step and now ready to ride the linux wave on windows shore. Thanks to you.

Collapse
 
homestaymom profile image
HomeStayMom

Great step-by-step tutorial. Small comment : zinit changed location as of 1st July 2022 the correct code should be updated to
sh -c "$(curl -fsSL raw.githubusercontent.com/zdharma-..."

Collapse
 
homestaymom profile image
HomeStayMom

➜ ~ curl -o- raw.githubusercontent.com/nvm-sh/n... | bash
for some reason didn't work for me. thus I tried

~ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion

➜ ~ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
➜ ~ nvm

Collapse
 
kosminskimateusz profile image
kosminskimateusz

Thanks a lot for this article :) It's very helpful. I'm the begginer and it works for me :)

Collapse
 
omarkhangithub profile image
Omar Khan

When doing..
source ~/.zshrc

I get the error:
Command Not Found: set

I am unable to proceed :(

Collapse
 
sim1029 profile image
Simon Schueller

Can be fixed by setting ZSH_THEME="spaceship" instead of the default theme at the top of the ~/.zshrc

Collapse
 
thecomitre profile image
Bruno Comitre • Edited

Valeu amigo. Você é um amigo

Prova que nem todo herói usa capa

Collapse
 
masen666666 profile image
masen666666

For step 7, zinit light zdharma/fast-syntax-highlighting was changed into
zinit light zdharma-continuum/fast-syntax-highlighting

Collapse
 
rajdeepmondal1 profile image
Rajdeep Mondal

Thank you

Collapse
 
mrtofuuu profile image
MrTofuuu

Is it possible to use a different theme on zsh? i wanted to use awesomepanda and seem to have messed my zsh as it won't open now.

Collapse
 
raman2106 profile image
raman2106

Iam stuck with the following error in step 9:
.zshrc:102: command not found: Set

Help!!

Collapse
 
bellkevin677 profile image
bellkevin677

SO I did this and skipped the theme at the end. I just need to get this to work on VScode. I have it installed on Debian distro now. I just don't know how to get this thing over onto VScode terminal.

Collapse
 
pradyuhebbar profile image
Pradyumna

It was awesome. It worked out well for me

Collapse
 
affanthebest profile image
Siddiqui Affan

Thank you for the amazing article.
However when I open terminal, it does not open with current workspace folder.
Do have any solution for it?

Collapse
 
samx23 profile image
Sami Kalammallah

Thank you for the guide, its so simple.

Collapse
 
crismerino profile image
Chris Merino

Followed all steps on Windows 10 Pro and now I have OhMyZSH working really good! Thank you!

Collapse
 
shayelbaz1 profile image
Shay Elbaz

It would be nice to get a Youtube video of this long frightening guide.
TNX.
If I will follow the guide I will make a video.

Collapse
 
pradyuhebbar profile image
Pradyumna

Thank you very much for this article.

Collapse
 
kamarguera profile image
Augusto Cesar Camargo

sh -c "$(curl -fsSL raw.githubusercontent.com/zdharma/..."

returning 404 error, can someone help?

Collapse
 
chaglr profile image
chaglr

Quite AMAZING !!!

Collapse
 
kamarguera profile image
Augusto Cesar Camargo

Perhaps Zinit installation changed it's link?

sh -c "$(curl -fsSL git.io/zinit-install)"

I found this URL is this correct ?

I hope I did some help

Collapse
 
kamarguera profile image
Augusto Cesar Camargo

Can you help? at the end it is showing this:

➜ ~ source ~/.zshrc
/home/kamarguera/.zshrc:106: command not found: Set
/home/kamarguera/.zshrc:154: bad pattern: /home/kamarguera/.nvm/nvm.sh[
➜ ~

Collapse
 
zaidrehman profile image
Zaid Rehman

Great work man. Keep it up.