/dotfiles

My dotfiles using GNU Stow, Homebrew, and Oh My Zsh

Primary LanguageShellMIT LicenseMIT

dotfiles License

These are my dotfiles. There are many like these, but these ones are mine.

Intended for a MacOS development environment development in JavaScript/TypeScript with Homebrew as the package manager, iTerm2 as the terminal emulator, Visual Studio Code as the primary editor, and zsh with Oh My Zsh as the primary shell.

Features

Installation

# Clone the repository into `~/.dotfiles`
git clone --recurse-submodules https://github.com/jeremy-code/dotfiles.git ~/.dotfiles
cd ~/.dotfiles

# Run initial installation script
./install.sh

# Otherwise, run the following commands manually

## Install Homebrew
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
## Install Oh My Zsh
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/HEAD/tools/install.sh)"

## Install Homebrew packages, MacOS App Store apps, and VS Code extensions
brew bundle --file ./homebrew/.Brewfile

## Activate Symlinks
stow config git homebrew zsh
stow -t "$HOME/Library/Application Support/Code/User" vscode
stow -t "$HOME/Library/Application Support/iTerm2/DynamicProfiles" iterm2

# Run extra scripts
source setup-mac.sh
source ssh.sh

Configuration

Git

The git directory contains git-related configuration files that are symlinked to ~/.config/git:

  1. git/.config/git/config for base Git configuration settings (name, email, etc.) and to set VS Code as default editor, diff tool, and merge tool.
  2. git/.config/git/ignore for global Git ignore rules.

GNU Stow

The directories config, git, homebrew are symlinked to home directory (~ or $HOME).

vscode and iterm2 are symlinked to their respective directories Code/User and iTerm2/DynamicProfiles in ~/Library/Application Support.

Homebrew

Homebrew is used to install Homebrew formulae and casks, MacOS App Store apps, and Visual Studio Code extensions. The list of packages and apps are defined in the homebrew/.Brewfile, which is symlinked to ~/.Brewfile. After installing and running stow, installation can be done with brew bundle --global.

Miscellaneous Homebrew environment variables are defined in homebrew/.homebrew/brew.env, which is symlinked to ~/.homebrew/brew.env.

iTerm2

The iterm2 directory contains the iTerm2 dynamic profile configuration file DynamicProfiles/profiles.json for custom color schemes, theming, and other settings, which is symlinked to ~/Library/Application Support/iTerm2/DynamicProfiles. It also contains the Scripts directory for custom scripts to be used in iTerm2, such as setting the default profile to the aforementioned dynamic profile in Scripts/AutoLaunch/change_default_profile.py.

Visual Studio Code

The vscode directory contains the Visual Studio Code settings file settings.json for custom settings, and snippets files snippets/*.json for custom code snippets. It uses One Dark Pro Darker theme, Fira Code font, and Material Icon Theme icon theme. It also sets up various extensions for language/library tooling (Prettier, ESLint, etc.) and miscellaneous utilities (Git Blame, Carbon, etc.).

zsh and Oh My Zsh

The default shell is zsh using the framework Oh My Zsh. Base zsh configuration files are located in the zsh directory, which set up PATH and Oh My Zsh.

Additional configuration is in oh-my-zsh directory (the ZSH_CUSTOM directory for Oh My Zsh). The files aliases.zsh, constants.zsh, telemetry.zsh are sourced here. The plugins, which are installed as Git submodules, are zsh-autosuggestions and zsh-syntax-highlighting for zsh utilities and zsh-nvm to automatically install and load nvm.

Config

The config directory contains miscellaneous configuration files, namely:

  1. .npmrc for NPM configuration settings
  2. .editorconfig for EditorConfig settings (matching Prettier's defaults)
  3. .gnupg for GPG signing with the pinentry program pinentry-mac.

License

This project is licensed under the MIT license.