Dotfiles & Friends
Don’t let your tools be tools.
iTerm2
Follow standard macOS installation procedure.
Select text settings (⌘+,):
Select a color scheme (⌘+,):
brew
Open Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
IMPORTANT: brew
can install itself in different locations depending on what OS or architecture you are using (e.g. M1 Macs use /opt/homebrew
whereas Intel Macs use /usr/local
). Be sure to use the correct path when running or configuring tools in the following steps. You can find the path to your installation by running:
brew config | grep HOMEBREW_PREFIX
Fira Code
Install with brew
:
brew tap homebrew/cask-fonts
brew install font-fira-code
⚠️ NOTE: You may need to go back and change the font in iTerm2 now that you have installed the correct font.
Visual Studio Code
Follow standard macOS installation procedure.
Install the following extensions (⌘+⇧+X):
- esbenp.prettier-vscode
- arcanis.vscode-zipfs
- eamodio.gitlens
- aaron-bond.better-comments
Configure ~/Library/Application Support/Code/User/settings.json
:
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.tabSize": 2
}
Open the command palette (⌘+⇧+P) to install command line tools:
Open the command palette (⌘+⇧+P) to pick a theme:
You can see a variety of themes at: https://www.vscodethemes.com/
fish
Install using brew
:
brew install fish
sudo sh -c 'echo "$(brew --prefix)/bin/fish" >> /etc/shells'
chsh -s $(brew --prefix)/bin/fish
Configure fish
by editing ~/.config/fish/config.fish
:
# Disable pointless banner
set fish_greeting ''
set -g fish_emoji_width 2# Get all homebrew binaries
fish_add_path $(brew --prefix)/bin
Open your terminal. You now have fish
.
starship
Install using brew
:
brew install starship
Configure starship
by editing ~/.config/starship.toml
:
add_newline = false[line_break]
disabled = true[directory]
truncation_length = 4
style = "white"
Configure fish
by adding to your ~/.config/fish/config.fish
:
# Launch starship. This line should ALWAYS be last.starship init fish | source
Restart your shell.
asdf
Install using brew
:
brew install asdf
Configure fish
by adding to your ~/.config/fish/config.fish
:
# Allow injection of `asdf` binaries into $PATH.
# This should come after any of your own modifications to $PATH.source $(brew --prefix)/opt/asdf/asdf.fish
IMPORTANT: The above snippet should also be provided after the brew
installation succeeds. Be sure to check the output of the command with what you are adding to your fish configuration.
direnv
Install using asdf
:
asdf plugin-add direnvasdf install direnv 2.31.0
asdf global direnv 2.31.0asdf direnv setup --shell fish --version 2.31.0
You can now add plugins to asdf
based on which languages/tools you use:
asdf plugin-add nodejs
asdf install nodejs 16.15.0
And then have them loaded via direnv
based on the project you are currently in. The following examples assume you are in a project.
mkdir myproj
cd myproj
Create a .tool-versions
file in your project:
nodejs 16.15.0
Create a .envrc
file in your project:
# This line must always come first.
use direnv# Add any environment variables you want.
export MY_VAR=test
Make sure the .envrc
file is allowed:
direnv allow
The tools you want should be available iff you are in the project directory:
node --version
echo $MY_VAR
jump
Install using brew
:
brew install jump
Configure fish
by adding to your ~/.config/fish/config.fish
:
if status is-interactive
source (jump shell fish | psub)
end
You can now immediately go to any of your projects via j
:
j my-proj