Where is the .zshrc file on Mac?
The ~/.zshrc
doesn’t exist by default in macOS so you need to create it. The ~/
translates to your user’s home directory and the .zshrc
is the ZSH configuration file itself.
So just open up a Terminal — or iTerm — window and create that file like this; I am using nano
as a text editor but feel free to use whatever text editor you feel comfortable with:
nano ~/.zshrc
And then set the ZSH_THEME
value to whatever value you want to use like this:
ZSH_THEME="robbyrussell"
Now to save the file in nano
just hit ctrl+X. When it prompts:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
Just type “Y” and then you will get a new prompt which looks something like this; just note the path /Users/giacomo/
will match your local user’s path:
File Name to Write: /Users/giacomo/.zshrc
Now just hit return and the file will be saved and you will now be back to the command line prompt in the Terminal. If you now exit from the Terminal and then open a new window, the ~/.zshrc
settings should now be loaded in.
The .zshrc
file is not present by default in macOS Catalina, we need to create it.
Steps for creation:
- Open Terminal
- Type
touch ~/.zshrc
to create the respective file. (touch
command will create the.zshrc
in your current directory but it will be hidden) - Hit Return
To view/open ~/.zshrc
you can do either of two things:
- Open Finder > Press Cmd+Shift+.
Or:
- Open Terminal > and type:
open ~/.zshrc
I am using macOS High Sierra, MacBook Pro.
After I installed a Theme, I also needed to change the ZSH_THEME
.
For me, ~/.zshrc
was already present in my Home directory, but it was Hidden.
I used Cmd + Shift + . to show the hidden files in Finder, then opened the ~/.zshrc
files with my editor. Updated it and saved it. It worked fine.