See dotfiles like .zshrc and .gitignore in Finder
Your .zshrc, .gitignore, and .gitconfig sit right in your home or project folder — but open Finder and they're gone. Any filename that begins with a dot is treated as hidden on macOS, a Unix convention Finder honours by default. To edit them from Finder, flip hidden files on: press Cmd+Shift+. for a quick look, or set a permanent preference for daily work.
The one-shot toggle
When you just need to grab a dotfile for a minute, the keyboard shortcut is the fastest route and leaves nothing to undo later.
- Open the folder in Finder — your Home folder for
.zshrcand.gitconfig, or a repo folder for.gitignore. - Press Cmd+Shift+. (Command-Shift-Period). Every dot-prefixed file appears, dimmed to mark it as hidden.
- Double-click the file to open it, or drag it onto your editor. Press Cmd+Shift+. again to tuck them away.
The toggle is per-Finder and flips the same underlying setting the Terminal command below controls — the shortcut just does it without typing.
Keep dotfiles visible for good
If you edit shell and git config often, showing dotfiles all the time saves the repeated shortcut. One Terminal command sets it:
# Show hidden files, including all dotfiles
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
killall Finder restarts Finder so the change lands right away. Want the clean view back? Write the opposite value:
# Hide dotfiles again
defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder
Both the shortcut and this command behave identically across macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.
Open a single dotfile without unhiding everything
Often you don't want a Finder full of dimmed system files — you just want to open this one dotfile. Finder's Go to Folder box takes you straight to it by name.
- With Finder active, press Cmd+Shift+G.
- Type the path, for example
~/.zshrcor~/.gitconfig, and press Return. - Finder reveals and selects that file even while hidden files are otherwise off — double-click to open it.
For a dotfile inside a project, the same trick works with a full path like ~/Projects/site/.gitignore. And if you live in Terminal, open ~/.zshrc or open -e ~/.gitignore opens it in your default editor or TextEdit without touching Finder at all.
A note on editing config files safely
Dotfiles are plain text, but they're loaded by tools that can be fussy about syntax. If you open .zshrc in TextEdit, switch it to plain-text mode first (Format → Make Plain Text) so it doesn't save smart quotes or rich formatting that your shell can't read. A dedicated code editor avoids that trap entirely and shows the leading dot in its file list, hidden or not.
Mainspring makes "show hidden files" a named toggle you flip when you're editing config and flip back after — no defaults command to recall. It's one of 90+ hidden macOS settings it turns into reversible switches.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
While you're editing .zshrc
Now that you can see it, it's worth making your shell config work harder. Our guide to customizing your .zshrc on Mac covers aliases, a better prompt, and PATH tweaks that pay off every time you open Terminal.