Skip to content
ryckPublic

About

My macOS dotfiles: Zsh, Spaceship, mise and modern CLI tools ~/.πŸ’–

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

561 Commits

Folders and files

Repository files navigation

ryck’s dotfiles

Website: dotfiles.ryck.dev, with a one-page reference of the shortcuts, aliases and plugins below.

A tour of the shell: zoxide, magic-enter, eza, bat, delta, syntax highlighting, autopair, smartdots, sudo, aliases, autosuggestions, Starship and per-project runtime versions

There are tons of useful things in here:

  • The usefulness of Oh My ZSH! is already built–in.
  • Starship as a prompt.
  • Tmux configured in ~/.tmux.conf, with tmux-lean: a minimal theme with process icons and light/dark colors.
  • Fish-like autosuggestion in Zsh.
  • Syntax highlighting of commands while they are typed.
  • Automatically closing and deleting of quotes and brackets when you type them.
  • Browser-like substring search for history.
  • zgenom (maintained fork of zgen) for dependency management.
  • mise for Node, Python and Go versions (replaces nvm, fnm and pyenv).
  • Atuin for searchable, synced shell history on Ctrl-R.
  • fzf and fzf-tab for fuzzy file, folder and completion pickers.
  • VS Code as $EDITOR, with the fresh terminal editor as fallback.
  • Lots of useful aliases.
  • Modern CLI tools like eza (smarter ls), bat (smarter cat), zoxide (smarter cd), delta, lazygit, ripgrep, fd, btop.
  • Git config, global .gitignore file and aliases.
  • Homebrew bundle for bootstrapping a macOS workstation (every package is listed in Brewfile.md).
  • A lot of useful bins.
  • update script for updating dotfiles, Zsh plugins, brew, mise runtimes, and apt packages.

Missing feature? Fork this repo and make it better.

Highlights

git pull never gets blocked

  • ~/.config is a real directory, not a symlink into the repo. Linking the whole folder would let every app write its state into the repo, so only the apps in config/ are linked one by one. See How ~/.config works.
  • App-owned configs (gh) are copied once from seed/ instead of linked. scripts/sync.sh compares them with the repo.
  • update refuses to pull over local edits and pulls with --rebase --autostash.

Shell

  • zgenom instead of zgen, which is archived. It's pinned to ~/.zgenom.
  • Fewer Oh My Zsh plugins: dropped nvm, fnm, pyenv, deno, a duplicate direnv, gpg-agent, ssh-agent, codex, node and yarn. Added mise.
  • tinted-shell instead of the abandoned base16-shell.
  • zsh-you-should-use instead of alias-tips, which started Python before every command (~30ms each).
  • fast-syntax-highlighting instead of zsh-syntax-highlighting.
  • Starship instead of Spaceship, configured in config/starship: Starship's defaults with Nerd Font icons for Go, Node, Python and package versions, plus lines added and removed in the repo (+3 -27), and how long slow commands took on the right. The AWS and gcloud profiles are hidden. The ❯ turns red when a command fails. Inside a project it shows the Node, Go or Python version mise picked for it. The whole prompt draws in ~45ms, where Spaceship showed part of it after ~65ms and filled in versions ~0.4s later. Its init script is cached, so it adds nothing to startup.
  • New Oh My Zsh plugins: copypath (copy the current folder's path), copyfile (copy a file's contents), copybuffer (Ctrl-O copies what you've typed), dirhistory (Option-←/β†’ back/forward through visited folders, Option-↑ parent folder), uv (completions), git-commit (git feat -s zshrc "msg" β†’ feat(zshrc): msg), magic-enter (Enter on an empty prompt runs gst -u . in a repo, ls elsewhere) and aliases (als git searches your aliases).
  • _extend_path checks PATH in pure zsh instead of running echo | tr | grep on every call.
  • EDITOR is VS Code (code --wait), falling back to fresh, then nano, then vim. Over SSH VS Code is skipped. Git and lazygit follow it. XDG_CONFIG_HOME is set.
  • Personal settings live in tracked lib/exports.zsh and lib/functions.zsh. custom/ stays a gitignored extension point.

Tools

  • mise manages Node (LTS), Python (latest) and Go (latest), replacing nvm, fnm and pyenv. update upgrades them, and bootstrap.sh installs them.
  • New CLI tools: atuin (history search on Ctrl-R), lazygit, ripgrep, fd, jq, yq, btop, tealdeer, uv, hyperfine (benchmarking).
  • Brewfile is rebuilt from what's actually installed on my Mac, with unused apps removed. Third-party taps are marked trusted: true. Brewfile.md explains how to use it and describes every package.
  • brew-usage lists installed Homebrew packages by when you last used them, to find ones to remove.

Startup time

Measured on my Mac with time zsh -i -c exit (warm, average of 3 runs):

Step Startup
Original setup (zgen, all plugins) ~0.85s
zgenom + dropping nvm/fnm/pyenv/deno ~0.72s
Dropping gpg-agent, ssh-agent, codex, node ~0.34s
Dropping yarn ~0.22s
Pure-zsh _extend_path ~0.18s
Adding you-should-use, fast-syntax-highlighting, copypath, copyfile, copybuffer, dirhistory, uv ~0.20s
Starship instead of Spaceship (measured with hyperfine, 20 runs) ~0.21s (Spaceship: ~0.22s)

That's about 4Γ— faster than the original setup, with more features. Most of the gain came from gpg-agent, which ran gpgconf on every shell start (~380ms), and yarn, which ran yarn global bin (~130ms).

Installation

Tell Git who you are using these commands:

git config -f ~/.gitlocal user.email "email@yoursite.com"
git config -f ~/.gitlocal user.name "Name Lastname"

Clone dotfiles repo:

# Clone dotfiles repo
git clone https://github.com/ryck/dotfiles.git $HOME/.dotfiles

# Go to the dotfiles directory
cd $HOME/.dotfiles

# Install dotfiles
./install

On a new Mac, then bootstrap it. This installs Homebrew, Git and Zsh, everything in the Brewfile (including mise), the Node/Python/Go runtimes from config/mise via mise install, and a few global npm packages:

./scripts/bootstrap.sh

./install also links config/agents/AGENTS.md into supported agent config directories when those directories already exist: ~/.codex, ~/.cursor, ~/.config/github-copilot, ~/.config/opencode, and ~/.claude (as CLAUDE.md).

Updating

Use a single command to get the latest updates:

update

This command refreshes sudo, pulls the latest dotfiles, reruns ./install --except shell, updates zgenom and Zsh plugins, and updates brew and mise when available.

update refuses to pull if the repo has uncommitted changes. Commit them, or move machine-specific settings to ~/.zshlocal, ~/.gitlocal or custom/.

How ~/.config works

~/.config is a real directory, not a symlink to this repo. Apps can write whatever they want there without touching the repo.

  • Linked configs live in config/ and are symlinked per app by install.conf.yaml (~/.config/ghostty β†’ config/ghostty, etc.). Editing them edits the repo. To track a new app, move its folder into config/ and add a link: line.
  • App-owned configs that apps rewrite themselves (gh config.yml) live in seed/. scripts/seed.sh copies them into $HOME once, only if they're missing, so the app owns the live copy and the repo never gets dirty.
    • ./scripts/sync.sh shows a diff between the live copies and seed/.
    • ./scripts/sync.sh --pull copies the live copies into seed/ so you can review and commit them.

Under the hood

Note: You may put your custom settings into ~/.zshlocal, or into custom/*.zsh (loaded automatically and never committed).

Projects tree

I suggest you to organize project folder as follows:

~/Projects
β”œβ”€β”€ Forks       # for GitHub fork
β”œβ”€β”€ Job         # for job projects
β”œβ”€β”€ Playground  # for short-term experiments
└── Repos       # for long-term projects

Keyboard shortcuts

Keys Does
Ctrl-R Search history with Atuin. Press Ctrl-R again to switch between all history, this machine, this session, and this folder.
↑ / ↓ Search history for commands starting with what you've typed
Tab Completion menu you can fuzzy-search (fzf-tab)
Ctrl-T Pick a file with fzf and insert its path
Esc then C Pick a folder with fzf and cd into it (Option-C if your terminal sends Option as Alt)
Esc Esc Re-run the current or previous command with sudo
Ctrl-O Copy what you've typed to the clipboard without running it
Enter on an empty prompt Run gst -u . (git status) in a repo, ls -lh elsewhere (magic-enter)
Option-← / Option-β†’ Back / forward through folders you've visited (dirhistory)
Option-↑ / Option-↓ Go to the parent folder / into the first subfolder
Ctrl-← / Ctrl-β†’ Jump one word back / forward
... Typing dots expands them: ... β†’ ../..

Aliases

Aliases are going to make your work fast and enjoyable. See code in $DOTFILES/lib/aliases.zsh. Here is what's included:

  • Aliases from Oh-My-Zsh. See Oh-My-Zsh Cheatsheet for more.
  • Easier navigation
    • .. β†’ cd ..
    • ... β†’ cd ../..
    • .... β†’ cd ../../..
    • ..... β†’ cd ../../../..
    • ~ β†’ cd ~
    • - β†’ cd -
  • Folders shortcuts
    • dl β†’ cd ~/Downloads
    • dt β†’ cd ~/Desktop
    • pj β†’ cd ~/Projects
    • pjr β†’ cd ~/Projects/Repos
    • pjf β†’ cd ~/Projects/Forks
    • pjj β†’ cd ~/Projects/Job
    • pjl β†’ cd ~/Projects/Playground
  • Commands Shortcuts
    • e β†’ open in $EDITOR without waiting (VS Code)
    • +x β†’ chmod +x
    • x+ β†’ chmod +x
    • reload β†’ reload ~/.zshrc
    • clr β†’ clear
    • q β†’ go home and clear the screen
  • Open
    • open <FILE> β€” open file from terminal.
    • o <FILE> β€” open file from terminal.
    • oo β€” open current folder.
    • term β€” open iTerm.
  • macOS
    • show / hide β€” show or hide hidden files in Finder.
    • cleanup β€” recursively delete .DS_Store files.
    • cdf β€” cd into the folder open in the front Finder window.
    • copypath β€” copy the current folder's path. copyfile <file> copies a file's contents.
  • Misc
    • update β€” get updates (Runs $DOTFILES/scripts/update.sh).
    • bootstrap β€” run machine bootstrap (Runs $DOTFILES/scripts/bootstrap.sh).
    • dotfiles β€” jump quickly into dotfiles folder.
    • myip β€” my local IP address.
    • password β€” generate random password, copies it into clipboard and outputs it to terminal.
    • path β€” print $PATH in readable view.
    • getpage β€” download web page with all assets.
    • get β€” download file with original filename.
    • git-root / cdgr β€” jump to the current repo root.
    • mkd <dir> β€” create a folder and cd into it.
    • extract <file> β€” unpack any archive.
  • Tools (only when installed)
    • help β†’ tldr.
    • lg β†’ lazygit.
    • md <file> β†’ render Markdown with glow.
    • top β†’ btop.
    • lt β†’ tree view with eza; l β†’ long list; la β†’ long list including hidden files.
    • cc β†’ claude; ccx β†’ Claude Code in ~/Projects/Playground with auto permissions.
    • cx β†’ codex; cxx β†’ Codex in ~/Projects/Playground with --full-auto.

Depending on installed tools, ls uses eza, cat uses bat, cd uses zoxide, and top uses btop. rm, cp and mv ask before deleting or overwriting (-i, from the common-aliases plugin).

Zsh plugins

Oh My Zsh plugins (see .zshrc):

Other plugins:

Bin

Dotfiles also include some functions that will make your life easier. See code in bin/.

  • brew-usage β€” list installed Homebrew formulae and apps by when you last used them, to spot ones you can remove.
  • emptytrash β€” empty the Trash on all mounted volumes and the main HDD.
  • git-cleanup β€” removes old Git branches and does other cleanup.
  • git-fork β€” add remote upstream.
  • git-upstream β€” sync branch with upstream.
  • gz β€” get gzipped file size
  • n β€” runs given command using binary in node_modules/.bin of the current project.
  • nyan β€” print nyan cat.
  • password β€” generate a random password and copy it to the clipboard.

Git

Note: Add your git user data and custom settings to ~/.gitlocal.

Configuration

  • UI color is auto.
  • Default branch is main.
  • Diff colors are:
    • white bold for meta information;
    • cyan bold for frag;
    • red bold for old lines;
    • green bold for new lines.
  • Diffs are shown with delta (line numbers, n/N to jump between files, clickable paths).
  • Editor follows $EDITOR (VS Code locally, fresh over SSH or without VS Code).
  • push.default set as current.
  • pull.rebase set to true.
  • push.autoSetupRemote set to true.
  • rerere enabled for conflict resolution reuse.
  • Automatic replacement git://github.com/, gh:, github: addresses as git@github.com: for GitHub.
  • Automatic replacement git://gist.github.com/, gst:, gist: addresses as git@gist.github.com: for Gists.
  • User custom settings gets from a ~/.gitlocal file.

Git Aliases

  • git a β†’ git add β€” stage files.
  • git ua β†’ git reset HEAD β€” unstage files.
  • git b β†’ git branch β€” list, create, or delete branches.
  • git c β†’ git commit β€” record changes to the repository.
  • git m β†’ git merge β€” merge branches.
  • git mc β†’ git merge --continue β€” continue merge after resolving conflicts.
  • git co β†’ git checkout β€” checkout a branch or paths to the working tree.
  • git cb β†’ git checkout -b β€” create and checkout branch.
  • git sw β†’ git switch β€” switch branches.
  • git swc β†’ git switch -c β€” create and switch branch.
  • git ap β†’ git add -p β€” stage changes hunk by hunk.
  • git ca β†’ git commit -a β€” commit with automatically stage files that have been modified and deleted.
  • git cm β†’ git commit -m β€” commit with commit message.
  • git cam β†’ git commit -am β€” add all files and commit with message.
  • git s β†’ git status -sb β€” short status with current branch.
  • git main β€” go to main branch and pull from remote.
  • git master β€” go to master branch and pull from remote.
  • git develop β€” go to develop branch and pull from remote.
  • git memain / git memaster β€” fetch latest main / master and merge it into the current branch.
  • git remain / git remaster β€” fetch latest main / master and rebase the current branch onto it (with autostash).
  • git git β€” do not complain about git git.
  • git l β€” commits log with pretty single line format.
  • git ll β€” log with list of changed files for each commit.
  • git ignore β€” ignore files: append file to .gitignore.
  • git this β€” initialize, add all files and commit.
  • git amend β€” amend last commit.
  • git redo β€” amend last commit with its original message.
  • git undo β†’ reset --mixed HEAD^ β€” reset index changes, but not the working tree.
  • git discard β†’ checkout -- β€” discard changes.
  • git contrib β€” list of contributors and how many commits each person has.
  • git today β€” see how many lines of code you have written today.
  • git sync β€” pull and push changes from/to remote.
  • git lazy β€” open lazygit.
  • git-root β€” go to repo root.
  • git-cleanup [--force] β€” removes old Git branches.
  • git-fork <original-author> β€” add remote upstream.
  • git-upstream [branch] β€” sync branch with upstream (defaults to master).

Resources

Resources that I used to make these dotfiles better:

Credits

Originally based on Denys Dovhan’s dotfiles.

License

MIT Β© Denys Dovhan, Ricardo Gonzalez

About

My macOS dotfiles: Zsh, Spaceship, mise and modern CLI tools ~/.πŸ’–

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages