A zsh-focused dotfiles starter template for MacOS, but lots of configurations are compatible with Linux.
Linux support is a work-in-progress. Create a Pull Request if you want to contribute!
First, fork this repo so you can start maintaining your own dotfiles repo, and name your fork dotfiles, not dotfiles-starter. Github instructions for working with forks
Follow the instructions for Configuring a remote repository for a fork if you want to sync changes from the source repo to your fork from the command line.
If you're on MacOS and setting up your computer for the first time or migrating computers, try running the MacOS System Settings script to speed up your computer setup. Some of the settings it can help you configure:
- Trackpad: Tap to click
- Trackpad: Natural scrolling
- Dock: Automatically hide and show the Dock
- Dock: Minimize windows using Scale/Genie effect
- Mission Control: Automatically rearrange Spaces
- Mission Control: Group windows by application
- Mission Control: Drag windows to top of screen
- Hot Corners
Pull Requests are welcome if you want to contribute additional settings!
- Install Brew
- Homebrew requires XCode Command Line Tools to be installed first
- Follow the instructions provided at the completion of the Brew installation process for adding a line to your
~/.zshrc. Also run theeval "... shellenv)"line in your current Terminal to start usingbrewright away. - In this repo, edit Brewfile(./Brewfile)
- From the root of this repo, run
brew bundle- this will install all apps listed in the Brewfile file
- Back up your current ~/.zshrc file
mv ~/.zshrc ~/.zshrc-backup
- Create a ~/.my-env-secrets file and copy over any secrets from your old .zshrc that you don't want committed to git
- Manually copy the my-env-secrets-example file from this directory to your
$HOMEdirectorycp ./my-env-secrets-example ~/.my-env-secrets
- There's probably a better way to manage environment secrets than this. Open to suggestions.
- Manually copy the my-env-secrets-example file from this directory to your
- In the dot-zshrc file,
- update the
DOTFILES_GIT_DIRvariable to match the location of this folder on your computer - copy any important settings from your ~/.zshrc-backup file to dot-zshrc in this folder
- update the
- (OPTIONAL) If you have a ~/.aws/config file, you may want to version control it in case it gets messed up:
- copy the contents into this repo's dot-aws/config file
cat ~/.aws/config >> ./dot-aws/config
- backup the old file
mv ~/.aws/config ~/.aws/config-backup
- copy the contents into this repo's dot-aws/config file
- Check for potential
stowconflicts:- From the root of this repo, run
stow --simulate --verbose .
- From the root of this repo, run
- From the root of this repo, run
stow . - Exit your current shell session and reopen a new one. Zinit will install itself and you'll get all of the updated settings applied to your new shell.
warp directory - bookmark directories - wd help
Recommendation: prefix your long/less-often-used aliases with a comma, e.g. ,git_browser_url.
- easier to find when autocompleting using Tab
- commas aren't special characters unlike other symbols ($, #, ?, etc.)
There are many suggested recommended (non comma-prefixed) aliases in this repo that are commented out. They're commented out so that they don't override other tools you may already have installed and use regularly, but feel free to uncomment them if you think they're useful. For example, see gs, ga, gd, gcam, gcam, in the git aliases file.
IMPORTANT: Be aware that this dotfiles setup, by default, overrides the following built-in CLI commands to help improve your workflow. If you don't want them, you'll have manually remove the overrides.
cd- replaced withzoxide. To undo, comment out or delete the env variableZOXIDE_CMD_OVERRIDEin dot-zshrc.ls- replaced witheza. To undo, comment out or delete the aliases-and-functions/ls file.kubectl- replaced withkubecolor. To undo, comment out or delete the aliases-and-functions/kubectl file.
Call ,alias_query to see a list of aliases/functions you currently have access to and their definitions. Navigate using the up/down arrow keys and invoke them by pressing Enter.
-,..,...,....(navigating to previous/parent directories withoutcd),alias_query,alias_source_query,cd_query/,cd_rankings/,zoxide_query/,zoxide_rankings,copy_branch/,copy_path/,copy_dirname,git_branch_query_fzf/,git_branch_query_remote_fzf,git_browser_url/,git_browser_url_copy,git_show_last_commit,git_undo_unpushed_commit-->,git_redo_unpushed_commit,replace_text_recursively,show_files/,hide_files,speedtest,tree
Refer to docs/keyboard-shortcuts.md for a list of useful builtin keybindings.
IMPORTANT: Be aware that this dotfiles setup, by default, adds/overrides the following built-in shell keybindings to help improve your workflow. If you don't want them, you'll have manually remove the overrides in keybindings.
- Ctrl+t - refer to the
fzfsection below - Ctrl+x then p - refer to the Ghostty AppleScript API section below
fzf which is installed in Brewfile comes with a useful shortcut.
<Ctrl-t> - opens a typeahead that can filter through directories and filenames under the current directory and pastes the selection into the current command prompt. Can be useful for git add [PATH_TO_FILE] operations after doing a git status to see which files have changed
Check out the Ghostty terminal which has been preconfigured in this repo in the Ghostty config file. Read more about it and install it from the official website: https://ghostty.org
Optional: for the best experience, download the JetBrains Mono font from https://www.jetbrains.com/lp/mono. Install it by opening the font file and choose Install. Then uncomment the line below in the dot-config/ghostty/config:
font-family = JetBrains Mono
| Shortcut | Action |
|---|---|
| Command+Shift+P | Activate Command Palette |
| Command+Shift+, | Reload Ghostty with latest config |
| Command+t | New tab |
| Command+w | Close tab |
| Ctrl+tab / Ctrl+Shift+tab | Next / previous tab |
| Command+d | New split to the right |
| Command+Shift+d | New split to the bottom |
| Command+[ / Command+] | Previous / next pane |
ghostty --help # see all available commands
ghostty +list-themes
ghostty +list-keybinds
ghostty +list-fontsGhostty has an API that works with AppleScript which allows you to write scripts to automate Ghostty in many interesting ways.
An example for the TVSim project has been added that demonstrates how a person on that team might want to automate their workflow of navigating to all of the git repositories related to that project at the beginning of their day. It requires that the exact paths to those git repositories exist on your computer.
For those who want to test out the script without those particular project directories, a more generic MacOS example has also been created that navigates to standard MacOS directories.
In your shell, call the function ,ghosttyProjectStartup (or type Ctrl+x then p) to choose from the list of .applescript files in scripts/ghostty/ and invoke them.
- What is this strange behavior happening with my
cdcommmand? It takes me to directories not in my current working directory.
cdhas been replaced byzoxide. See the #aliases section above to learn more or if you wish to revert back to the built-incdcommand.
- How is my prompt being customized and how can I change it?
- The prompt is managed by Oh My Posh. You can configure it by editing dot-config/ohmyposh/ohmyposh.toml or deleting that file if you want to revert to the default prompt setup.