joshukraine/dotfiles

website github github
ai-agentsasdfclaude-codedotfilesghosttykittylazyvimluamacosneovimneovim-configneovim-dotfilesrailsrubytmuxvimzsh
stars 403
issues 2
subscribers 3
forks 51
CREATED

UPDATED


My Dotfiles for macOS

dotfiles screenshot

๐Ÿคฉ Highlights

  • Neovim editor configured with LazyVim๐Ÿ’ค
  • Starship prompt
  • Zsh shell with zsh-abbr for abbreviations
  • Flexible, terminal-based dev environment with ghostty ๐Ÿ‘ป + Tmux!
  • Fast, idempotent setup with GNU Stow
  • New Mac bootstrap based on thoughtbot's Laptop
  • Support for both Apple Silicon and Intel Macs

[!NOTE] This project previously supported Fish shell alongside Zsh. Fish support was removed in PR #135 (f158de9). If you were using the Fish configuration, you can reference that PR to see what changed or recover code for your own setup.

โšก๏ธ Quick Setup

Make sure macOS is up to date and you have installed the required software.

Clone this repo.

git clone https://github.com/joshukraine/dotfiles.git ~/dotfiles

Read the setup script and check available options.

less ~/dotfiles/setup.sh
~/dotfiles/setup.sh --help

Preview what the setup script will do (dry-run mode).

~/dotfiles/setup.sh --dry-run

Run the setup script.

~/dotfiles/setup.sh

โœ… Prerequisites

The dotfiles assume you are running macOS with (at minimum) the following software pre-installed:

All of the above and more are installed with my fork of Laptop.

๐ŸŒŸ New Mac Bootstrap

This is what I would do if I bought a new Mac computer today. The steps below assume you have already completed the basics:

๐Ÿ’ป 1. Run my fork of thoughtbot's Laptop

github.com/joshukraine/laptop

Download the mac script:

curl --remote-name https://raw.githubusercontent.com/joshukraine/laptop/main/mac

Download .local.laptop for additional customizations:

curl --remote-name https://raw.githubusercontent.com/joshukraine/dotfiles/master/laptop/.laptop.local

Review both scripts before proceeding:

less mac
less .laptop.local

Execute the mac script:

sh mac 2>&1 | tee ~/laptop.log

I've made the following changes to my fork of Laptop:

  • Install asdf via git instead of Homebrew
  • Comment out Heroku-related code
  • Comment out unused Homebrew taps and formulae

It is worth noting that the Laptop script (mac) is idempotent and can be safely run multiple times to ensure a consistent baseline configuration.

โš ๏ธ 2. Check for Stow conflicts

The dotfiles setup.sh script uses GNU Stow to symlink all the config files to your $HOME directory. If you already have an identically-named file/directory in $HOME (e.g. ~/.zshrc leftover from installing Laptop), this will cause a conflict, and Stow will (rightly) abort with an error.

The setup script will try to detect and backup these files ahead of Stow, but it's still a good idea to check your $HOME directory as well as $HOME/.config and $HOME/.local/bin.

๐Ÿ“ 3. Clone and setup the dotfiles

Clone

git clone https://github.com/joshukraine/dotfiles.git ~/dotfiles

Read and preview

less ~/dotfiles/setup.sh
~/dotfiles/setup.sh --help
~/dotfiles/setup.sh --dry-run  # Preview changes without applying them

Setup

~/dotfiles/setup.sh

If you do encounter Stow conflicts, resolve these and run setup again. The script is idempotent, so you can run it multiple times safely.

โšก๏ธ 4. Install Zap

Zap describes itself as a "minimal zsh plugin manager that does what you expect."

zapzsh.com

[!IMPORTANT] After copying/pasting the install command for Zap, be sure to add the --keep flag to prevent Zap from replacing you existing .zshrc file.

๐Ÿบ 5. Install remaining Homebrew packages

Review the included Brewfile and make desired adjustments.

less ~/Brewfile

Install the bundle.

brew bundle install

๐Ÿ› ๏ธ 6. Complete post-install tasks

Zsh Setup

Zsh is now the default shell on macOS. However, it's helpful to add an entry enabling the Homebrew version of Zsh (/opt/homebrew/bin/zsh on Apple Silicon, /usr/local/bin/zsh on Intel) instead of the default (/bin/zsh) version.

Ensure that you have Zsh from Homebrew. (which zsh) If not:

brew install zsh

Add Zsh (Homebrew version) to /etc/shells:

# Apple Silicon Macs:
echo /opt/homebrew/bin/zsh | sudo tee -a /etc/shells

# Intel Macs:
echo /usr/local/bin/zsh | sudo tee -a /etc/shells

# Or use this universal command:
echo $(which zsh) | sudo tee -a /etc/shells

Set it as your default shell:

chsh -s $(which zsh)

Install Zap.

Restart your terminal.

Abbreviations

One of the best ideas I picked up from using Fish shell is abbreviations over aliases. zsh-abbr brings this functionality to Zsh.

Abbreviations are managed directly in zsh/.config/zsh-abbr/abbreviations.zsh. You can edit this file directly, or use the abbr add/abbr remove commands in your shell.

Smart Git Functions

The configuration includes intelligent git functions that automatically detect your main branch:

  • gpum - Push current branch to origin with upstream tracking
  • grbm - Rebase on main/master
  • gcom - Checkout main/master
  • gbrm - Remove branches merged into main/master

These functions work with both main and master branch names automatically.

About Neovim Distributions

[!TIP] TL;DR: Just install LazyVim๐Ÿ’ค

๐Ÿ“บ Zero to IDE with LazyVim

Back in the day if you wanted to use Vim (and later Neovim) you had to code a ton of configuration on your own. With Vim we got Vimscript ๐Ÿคข, but then came Neovim which brought us Lua ๐Ÿคฉ. I went from ye olde crunchy .vimrc to the more adventurous init.vim to the blessed path of init.lua. ๐Ÿ˜‡

Meanwhile, there were the VS Code boys across the fence, bragging about their fancy icons, shiny tabs, and the oh-so-cool LSP. I confess, I even tried VS Code for a bit. That didn't last long. ๐Ÿ˜ฌ

But Neovim has caught up. And wow have they. caught. up. Not only do we have native LSP support in Neovim (have had for a while now โ€” v0.5), but we are solidly in the era of pre-baked Neovim distributions that are really challenging the notion of Vim/Neovim as austere, command-line editors. (I will say that I think we owe a lot to VS Code for raising the bar here. But I'm still glad I'm with Neovim. ๐Ÿ˜‰)

If you want a quick primer on Neovim distros, check out the YouTube video below. I started with LunarVim (my first entry into distro-land) and now I'm with LazyVim and the Folke gang. Bottom line: you can still config Neovim from scratch if you want to, but you can get a HUGE head-start by just grabbing a distro and tweaking it to your needs.

๐Ÿ“บ I tried Neovim Distributions so you don't have to

Boy, when I reminisce about the days of writing PHP for Internet Explorer in BBEdit...

My Favorite Programming Fonts

Over the years, I've branched out to explore a variety of mono-spaced fonts, both free and premium. Here is a list of my favorites.

Free Fonts

Included in my Brewfile and installed by default via Homebrew Cask Fonts

Premium Fonts

You have to give people money if you want these. ๐Ÿค‘

Ligatures

I first discovered ligatures through Fira Code, which IMHO is probably the king of programming fonts. After using Fira Code, it's hard to go back to a sans-ligature typeface. Therefore all the fonts I've included in my fave's list do include ligatures, although some have more than others.

[!NOTE] Operator Mono does not include ligatures but can be easily patched to add them.

Nerd Fonts and Icons

Back in the day, I started using the VimDevicons plugin so I could have fancy file-type icons in Vim. (Remember NERDTree?) In order for this to work, one had to install patched "Nerd-font" versions of whatever programming font one wanted to use. For example:

# Original font
$ brew install --cask font-fira-code

# Patched variant
$ brew install --cask font-fira-code-nerd-font

Patching fonts with icons still works fine of course, and is, I think, pretty widely used. However, during my exploration of kitty, I discovered that there is a different (better?) approach to icon fonts. It turns out, you don't need a patched version of your chosen mono-spaced font. You can get most if not all the icons you need and use them alongside any font by just installing the Symbols Nerd Font Mono font.

Leveraging this approach depends on your terminal. In iTerm2, for example, you need to check "Use a different font for non-ASCII text" in the Preferences panel. Then select Symbols Nerd Font Mono font under "Non-ASCII font". (see screenshot below)

iterm2-font-settings

kitty does things a little differently. If you install a patched font, it will mostly work. Mostly. But the "kitty way" can be broken down in three steps:

  1. Install a normal, un-patched mono-spaced font, such as Cascadia Code
  2. Install a dedicated icon font, such as Symbols Nerd Font Mono
  3. Create a set of Unicode symbol maps^2 to tell kitty which font to use for which icons (symbols)

More work up front, maybe, but less guesswork in the long-term once you understand what's going on. And if you're using my dotfiles, you have it easy. All the fonts you need are installed in Brewfile, and I have a set of Unicode symbol maps ready to go. ๐Ÿ˜Ž

[!NOTE] To learn more about Nerd fonts in terminals, as well as Unicode symbol maps and all the rest, be sure to check out Effective Nerd Fonts in Multiple Terminals by Elijah Manor

๐Ÿงช Nerd Font Smoke Test

If you want to check whether icons and ligatures are working properly, try running the included nerd-font-smoke-test.sh script from the root of the dotfiles folder like so:

bash nerd-font-smoke-test.sh

If your terminal is configured correctly, the output of the test should look like this:

smoke-test-output

Again, thank you, Elijah Manor!

Useful Font Links

A Note about Vim performance and Ruby files

Once upon a time, I almost left Vim due to some crippling performance issues. These issues were particularly painful when editing Ruby files. I documented what I learned here:

What I've learned about slow performance in Vim

Identifying Sources of Slow Startup Times (Zsh)

The .zshrc script can be profiled by touching the file ~/.zshrc.profiler and starting a new login shell. To see the top 20 lines that are taking the most time use the zshrc_profiler_view. zshrc_profiler parameters are number of lines to show (20) and path to profiler log file ($TMPDIR/zshrc_profiler.${PID}log).

Awesome Neovim Dotfiles, Distros, and Starters

Some of my favorite dotfile repos

Helpful web resources on dotfiles, et al

Customization

Local customizations should be placed in *.local files:

  • ~/.gitconfig.local - Personal git configuration
  • ~/.laptop.local - Additional laptop setup customizations

License

Copyright © 2014โ€“2026 Joshua Steele. MIT License