This is my ZSH configuration and personal dotfiles. Please review everything before you attempt to use this. Some things might be macOS-specific, but I try to keep everything as platform-agnostic as possible. This is a public repository mostly for easy installs on additional machines, but feel free to take a look!
- ZSH configured as the default shell (it is by default on macOS)
- Git is installed (on macOS, install using
xcode-select --install) - Homebrew is installed (install from brew.sh)
- Make sure zsh is the default shell:
echo $SHELL(if not, set it as default usingchsh -s [path_to_zsh]) - Optionally, fork this project and use your own repo below (best so you can customize it and push your changes back)
- Install and select a Nerd Font in Terminal (see "Font" below)
- Install homebrew (also required on Linux for many tools that are very boilerplatey to install on various distros otherwise)
- Install
chezmoiusingbrew - Run
chezmoi init --force --apply [this_repos_url] - Open a new shell to view the results
chezmoi(dotfiles manager, applies the files in this repo to your$HOME)antidote(ZSH plugin manager, reads plugins fromdot_config/zsh/antidote/plugins.txt)starship(modern customizable prompt)
zoxide(zdirectory jumper command)zellij(pane-based terminal multiplexer)eza(replaceslswith an alias)rg(ripgrep, fast search)fzf(fuzzy finder) +fzf-tabplugin (fzf-enhanced tab completion)bat(replacescatwith an alias)btop(topalternative)tlrc(modern tldr client with quick cheat sheets)lazygit(git TUI)jq(JSON processor and URI encoding/decoding helper)- Some other ZSH plugins and niceties (installed using antidote)
- A few aliases and tools to make life easier (
mkcd,uuid,url-encode,url-decode,escape-json,unescape-json,escape-xml,unescape-xml,escape-js,unescape-js,base64-encode,base64-decode,md5-file,sha256-file,reveal, git and ripgrep shorthands, etc.)
These commands can be used instead of the chezmoi and antidote commands in most cases.
dot-updatepulls the latest changes, applies them, and updates ZSH plugins in one go via chezmoidot-applyapplies the working copy's state to your home directory and updates ZSH pluginsdot-pushpushes local dotfiles commits from the chezmoi source repo to upstreamdot-statusshows local-only and remote-only dotfiles commits relative to upstreamdot-logshows the chezmoi source repo history as a decorated graph
Use chezmoi commands such as chezmoi edit or open ~/.local/share/chezmoi (which contains the dotfiles working copy) in your editor of choice. Make any changes you want, commit them, then run chezmoi apply to apply those changes to your home folder. Make sure to push the changes back to the remote for backup and sharing with your other machines!
~/.zshrc_localis sourced during shell startup and can be used for machine-specific exports, PATH additions, and tool initialization that should stay out of the shared dotfilesPROMPT_HOST_COLORcan be set in~/.zshrc_localto give that machine a distinct first Starship prompt capsule color, for exampleexport PROMPT_HOST_COLOR='#5e8ffb'
Ctrl-X Ctrl-Eopens the current command in$VISUALor$EDITORCtrl-Jinserts a literal newline into the current shell buffer so multiline commands can be edited as one buffer without triggeringPS2
This repository is public, so secrets should never be committed here in plain text.
- Use
~/.zshrc_localfor machine-local configuration - Do not store API keys, tokens, private certificates, passwords, or similar sensitive values in tracked dotfiles.
To get nice glyphs in the pre-configured Starship prompt, install a Nerd Font. You can choose any font that has been patched with the Nerd Fonts patcher (many options here), but I recommend using SF Mono Nerd Font which is derived from the SF Mono font by Apple (the Mac's default Terminal font).
Install it through homebrew: brew tap epk/epk && brew install font-sf-mono-nerd-font then select the regular weight in your Terminal profile.
This setup integrates fortinmike/osc52pty (an updated fork of roy2220/osc52pty) so supported terminal editors such as micro can copy text to the local Mac clipboard from a remote host while running in SSH sessions in Terminal.app which normally does not support that.
This requires the remote host to also have these dotfiles installed OR alias micro=micro -clipboard terminal in its ZSH config OR manually running micro with the -clipboard terminal flag, otherwise the clipboard won't propagate to the local Mac. The keyboard shortcuts are the same as micro running locally:
Ctrl-C: copy selected text in the editor to your local Mac clipboardCmd-V: paste from your local Mac clipboard
Ctrl-V is not implemented in our osc52pty fork because it would allow remote processes to grab the local clipboard without user interaction at any time.