Skip to content
/ dotfiles Public template

My setup for 🐠 Fish shell on  macOS - v3

Notifications You must be signed in to change notification settings

edheltzel/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dotfiles logo

Ed Heltzel's personal configuration for MacOS and Fish shell.

My playground revolves around DevOps and Full stack web development.

🧰 Terminal toolkit with replacements for Unix commands

I find tools that are built with Rust or Go to be performant and cover 90% of my use cases.

  • bat Rust replacement for cat
  • bottom Rust replacement for top
  • Bun - A drop-in-replacement for NPM/PNPM/Yarn - written in Zig
  • eza Rust replacement for ls
    • exa Rust replacement for ls - replaced with eza
    • exa site is still valid for EZA configurations
  • fd Rust replacement for find
  • fzf a mostly Go fuzzy finder
  • procs Rust replacement for ps
  • ripgrep Rust replacement for grep
  • sd Rust replacement for sed
  • starship Rust prompt
  • tealdeer Rust replacement for man
  • topgrade Rust replacement for package manager updates
  • zoxide Rust companion for cd and replacement for z and auto jump

βš™οΈ Usage and the Install

Caveats If you are on any version of macOS that uses AFPS, you'll need to disable the SIP. First check to see if SIP is enabled or not.

csrutil status

output should read:

System Integrity Protection status: enabled.

If your SIP is enabled, then follow the next steps to disable it – Assuming that you know what you're doing, here is how to turn off System Integrity Protection on your Mac.

  1. Turn off your Mac (Apple > Shut Down).
  2. Hold down Command-R and press the Power button. Keep holding Command-R until the Apple logo appears.
  3. Wait for OS X to boot into the OS X Utilities window.
  4. Choose Utilities > Terminal.
  5. Enter csrutil disable.
  6. Enter reboot.
  7. csrutil status -> should read System Integrity Protection status: disabled.

SSH Keys

I use ssh keys to authenticate with GitHub and other services. You generally want to create new keys for each device you use, but you can also use the same key on multiple devices. I have started using two different keys for my multi-machine work flow. One key is for my personal devices and the other is for my work devices. This allows me to easily revoke access to my work devices if I discontinue a relationship with a company or customer, and not have to worry about my personal keys being compromised or having to change them.

If you look at the .gitconfig you'll see the use of two different keys.

  1. Restore your safely backed up ssh keys to ~/.ssh/
  • I personally use Dropbox to keep these keys and configuration in sync with my devices, it's not ideal but works for me:
    • touch ~/Dropbox/.ssh-config && ln -s ~/Dropbox/.ssh-config ~/.ssh/config
    • Again you can alternatively, generate new ssh keys, and add these to your GitHub account.
  1. Clone this repository
git clone [email protected]:edheltzel/dotfiles.git
  1. Run the bootstrap.sh script
    1. Alternatively, only run the setup.sh scripts in specific subfolder if you don't need everything - You must start with the ./packages/.setup.sh script first. This will prevent any installation errors.
  2. Install Fisher and Plugins -- Optional
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher

πŸ—οΈ Customization

I would encourage you to play around with the configurations so you can add or remove features. If you would like to use these dotfiles for yourself, I'd recommend changing following:

  • Git

    • The .gitconfig file includes my [user] config, replace these with your own user name and email as well as the [include] path for your local gitconfig.
      • Almost all of git aliases are located in .gitconfig versus _aliases.fish or fish/functions/setup.fish - I've found this to work best for me.
    • Also check the .gitignore_global for anything you might want to add or remove.
    • I would also change the name of the local gitconfig file to match your setup.
      • gitconfig-bigmac.local and gitconfig-macdaddy.local are my two local gitconfig files.
  • OSX

    • At the top of the setup.sh file, my computer name is set as MacDaddy - might want to change it.
  • Packages

    This folder is a collection of the programs and utilities I use. The lists can easily be amended for your workflow.

    • Brewfile
    • python_packages.txt
    • ruby_packages.txt
    • rust_packages.txt
    • pnpm_packages.txt

    If you would rather run each text file individually, you can run the following command as an example:

    Fish πŸ‘‰ pnpm add --global (cat pnpm_packages.txt)
    Bash πŸ‘‰ pnpm add --global $(cat pnpm_packages.txt)

  • Repos

    This folder is a collection of repos I like to sync between my machines. The lists can easily be amended for your workflow. Just add the repo name to the txt file and it will be cloned. To customize, just update the name of the oss.txt file to match the name of the directory you want these repos to be cloned to.

    • oss.txt - My personal OSS projects that I like to keep in sync

πŸ“ Contents

Root (/)

  • bootstrap.sh - Calls all setup.sh scripts and executes.

Config (config/)

setup.sh - Symlinks all .files to their corresponding location in ~/.config/

  • bat/
  • iterm/
  • raycast/
  • utils/
  • vscode/
  • .ackrc
  • .gemrc
  • .gitnow
  • .hushlogin
  • .nirc
  • .npmrc
  • .profile
  • .tigrc
  • .tmux.conf
  • .vsce
  • .wgetrc
  • .zhsenv
  • .zshrc
text settings iTerm iterm text settings

Duti (duti/)

  • setup.sh - Sets the default app for the different file extensions.
  • app.package.id - Contains all extensions for the specified program (run tldr duti OR man duti to learn more)

Fish (fish/)

  • setup.sh - Symlinks all fish files to their corresponding location in ~/.config/fish/

  • config.fish - Global fish configuration (.fishrc)

  • fish_plugins - list of Fisher plugins to install

  • completions/

    • alacritty.fish - Contains all completions for the alacritty command
    • tmuxinator.fish - Contains all completions for the mux command
  • conf.d/

    • abbr.fish - Contains all abbreviations
    • colors.fish - Contains all color definitions
    • exports.fish - Contains all exports
    • fnm.fish - Contains all fnm completions
    • paths.fish - Contains all paths
    • tmux.fish - Contains all tmux completions
    • variables.fish - Contains all variables ie: $EDITOR
  • functions/

    • _aliases.fish - Contains all aliases
    • _utils.fish - Contains special scripts
    • abbrex.fish - Utility for expanding abbreviations in fish-scripts
    • btm.fish - Runs [btm]
    • cd.fish - Changes directory and lists contents
    • cp.fish - Copies files and directories
    • cpwd.fish - Copies the current working directory to the clipboard
    • fish_greeting.fish - My personal fish greeting using the full-color fish logo
    • git-undo.fish - Undo a the last commit message and reset the HEAD
    • imgcon.fish - Converts images to different formats
    • mkbak.fish - Creates a backup of a file
    • mkd.fish - Creates a directory and changes into it
    • pubkey.fish - Copies the public key to the clipboard
    • reload.fish - Reloads fish
    • restore.fish - Restores a file from a backup
    • setup.fish - reloads and sets fish abbreviations - DEPRECATED - use abbr -a inside of conf.d/abbr.fish instead
    • upp.fish - macOS ONLY checks current global node version and runs topgrade command
    • weather.fish - using wttr.in to check the local weather
    • wget.fish - alias for wget -c
    • speed.fish - macOS ONLY leverages the built-in networkQuality cli tool - just a glorified alias but works with all the flag options
speed summary
> speed
==== SUMMARY ====
Uplink capacity: 232.603 Mbps (Accuracy: High)
Downlink capacity: 887.549 Mbps (Accuracy: High)
Responsiveness: Medium (570 RPM) (Accuracy: High)
Idle Latency: 32.708 milliseconds (Accuracy: High)
Interface: en0
Uplink bytes transferred: 363.870 MB
Downlink bytes transferred: 1.987 GB
Uplink Flow count: 20
Downlink Flow count: 16
Start: 8/27/23, 5:32:12 PM
End: 8/27/23, 5:32:32 PM
OS Version: Version 13.5.1 (Build 22G90)

Update All The Things

  • using Topgrade by r-darwish -- see prompt > topgrade.tmol for config options.
  • a fish function exist upp to check current global node version and to run the topgrade command

Git (git/)

  • setup.sh - Symlinks all git files to ~/
  • .gitignore_global - Contains global gitignores, such as OS-specific files and several compiled files
  • .gitconfig - Sets several global Git variables - also include GPG signing

Commit and Tag Signing

SSH Commit Signing

This is the my preferred way setup for Git Commit/Tag Signing. Using your SSH key "simplifies signing Git commits and tags" on both Github and Gitlab. This is a great way to secure your commits and verify that you are the one making the commits, without all the setup and maintaining hassle GPG can come with. IDK why but sometimes it just stops working Β―_(ツ)_/Β―

The .gitconfig includes a line that adds support for an additional gitconfig file .gitconfig.local - my personal setup uses two different Macs and this is how I achieve commit signing with each machine.

  [meta]
    isLocalConfig = true
  [user]
    signingkey = PATH_TO_YOUR_KEY
  [gpg "ssh"]
    allowedSignersFile = PATH_TO_YOUR_ALLOWED_SIGNERS_FILE
  • PLEASE REVIEW ./git/setup.sh, this script checks what the computer name is and sets the .gitconfig.local, you'll want to update this to your computer name.
GPG Commit Signing

(optional): GPG signing is set to TRUE by default πŸ‘‰ If you DO NOT want to enable GPG run git config --global commit.gpgsign false and remove the GPG packages from the Brewfile.

renew expired gpg

Generate new key and assign to global git config

main take away:

  • gpg --list-secret-keys --keyid-format=long
  • Copy key
  • set key for your git user
    • git config --global user.signingkey <your key>

git config --global user.signingkey

  • look ma' verified
  • If you need help setting this up GPG:
  • Please Note if you used the Brewfile, Cask installed the macOS GPG Suite via cask 'gpg-suite-no-mail' -- (alternatively) update the Brewfile with `cask 'gpg-suite' to include GPGMail.

macOS Preferences (macos/)

  • setup.sh - Executes a long list of commands pertaining to macOS Preferences
    • I can not stress enough to read this and change this for what works for you.
    • DO NOT blindly run this script - it is a WIP with each macOS update things change.

Misc Dotfiles (misc/)

  • setup.sh - Symlinks all the associated rc and other dot files to your ~/ (home directory)
  • Special Mentions:
    • .tigrc - tig – configured with pretty colors and layout for git diff and logs
    • .eslintrc - has specific configuration for my JS workflow
    • bat/config - bat – a clone of cat with syntax highlighting

Packages (packages/)

  • setup.sh - Installs the contents of the package manager files and the Brewfile

Repositories (repos/)

  • setup.sh - Clones the repositories in the `` files at the corresponding locations

Vim (nvim/)

I use NeoVim, when I need Vim. The distribution I use is LazyVim

  • setup.sh - Clone LazyVim to ~/.config/nvim

Helper Scripts (scripts/)

  • functions.sh - Contains helper functions for symlinked files and printing progress messages

Node development

Node Version switching for Node development, takes advantage of fnm for managing Node versions, which supports both .nvmrc and .node-version files.

  • Install happens in the Brewfile by running
brew install fnm

For Completions run:

fnm completions --shell fish

Make sure you run:

./fish/./setup.sh

This will symlink the fnm.fish file in ~/.config/fish/conf.d (It might be helpful to source ~/.config/fish/config.fish)

Note: FNM has the ability to auto switch Node versions if there is a .node-version or .nvmrc file - this is enabled by default

# automatically run fnm use
fnm env --use-on-cd | source

Please note that when you change your default Node version, you will need to run npm install --global (cat node_packages.txt) to include corepack in the global packages. This will ensure that pnpm and yarn are available.

πŸ™ Special Thanks

Gotta thanks to kalis.me blog post for the simple setup, and inspiration.