1
mirror of https://github.com/jakejarvis/dotfiles.git synced 2026-04-28 18:46:17 -04:00
This commit is contained in:
2026-02-19 13:10:18 -05:00
parent c93d4561f1
commit 102dff6d61
44 changed files with 846 additions and 9265 deletions
+8
View File
@@ -0,0 +1,8 @@
{{- $name := promptStringOnce . "user.git.name" "Git user name for the author/committer" -}}
{{- $email := promptStringOnce . "user.git.email" "Git user email for the author/committer" -}}
{{- $signingkey := promptStringOnce . "user.git.signingkey" "Git user signing key for the author/committer" -}}
[data.user.git]
name = {{ $name | quote }}
email = {{ $email | quote }}
signingkey = {{ $signingkey | quote }}
-10
View File
@@ -1,10 +0,0 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azohra/shell-linter@master
-14
View File
@@ -1,14 +0,0 @@
# auto-generated files
.zcompdump*
.zcompcache*
# compiled .zsh sources
*.zwc
# homebrew lockfile
Brewfile.lock.json
# oopsie proofing
**/.ssh/known_hosts*
*id_rsa*
*id_ed25519*
-333
View File
@@ -1,333 +0,0 @@
###############################
# Taps #
###############################
tap "1password/tap"
tap "dart-lang/dart"
tap "dopplerhq/cli"
tap "hashicorp/tap"
tap "homebrew/aliases"
tap "homebrew/autoupdate"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
tap "microsoft/git"
tap "ngrok/ngrok"
tap "planetscale/tap"
tap "sass/sass"
###############################
# Formulae #
###############################
# perhaps most importantly...
brew "zsh" unless OS.linux?
# modern bash as a backup
brew "bash" unless OS.linux?
# correct Apple's GPL stubbornness...
brew "coreutils" if OS.mac?
brew "findutils" if OS.mac?
brew "gnu-sed"
brew "gnu-tar"
brew "gnu-which"
brew "gnupg" if OS.mac?
brew "gnutls"
brew "grep"
brew "make"
# more recent versions of some other macOS tools/libraries
brew "bzip2", link: true
brew "curl", link: true
brew "gcc"
brew "icu4c"
brew "less"
brew "libffi"
brew "libxml2"
brew "nano"
brew "ncurses"
brew "openssh" unless OS.linux?
brew "openssl@1.1" if OS.mac?
brew "readline"
brew "screen"
brew "sqlite"
brew "tcl-tk"
brew "unzip", link: true
brew "vim" #, args: ["with-override-system-vi"]
brew "wget" #, args: ["with-iri"]
brew "whois", link: true
brew "zlib"
# common binaries/libraries
brew "ffmpeg" #, args: ["with-libvpx"]
brew "fx"
brew "gettext"
brew "groff"
brew "guetzli"
brew "htop" if OS.mac?
brew "hyperfine"
brew "imagemagick" #, args: ["with-webp"]
brew "jemalloc"
brew "jq"
brew "libsass", args: ["HEAD"]
brew "libyaml"
brew "mhash"
brew "mtr"
brew "p7zip"
brew "pkg-config"
brew "protobuf"
brew "rlwrap"
brew "rsync"
brew "tmux"
brew "tree"
brew "webp"
brew "xz"
brew "yq"
brew "zopfli"
# Git (and GitHub/GitLab CLIs)
brew "git"
brew "git-lfs"
brew "gh"
brew "glab"
# mostly development stuff
brew "1password/tap/1password-cli" if OS.mac?
brew "asciinema"
brew "aws-shell"
brew "awscli"
brew "carthage" if OS.mac?
brew "cocoapods" if OS.mac?
brew "composer"
brew "croc"
brew "dart-lang/dart/dart"
brew "deno"
brew "dive"
brew "doctl"
brew "dopplerhq/cli/doppler"
brew "fnm"
brew "go"
brew "hashicorp/tap/packer"
brew "hashicorp/tap/terraform"
brew "hashicorp/tap/vault"
brew "httpie"
brew "httrack"
brew "hugo", args: ["HEAD"]
brew "iproute2mac" if OS.mac?
brew "mariadb" unless OS.linux?
brew "mas" if OS.mac?
brew "mkcert"
brew "mysql-client" unless OS.linux?
brew "neofetch"
brew "neonctl"
brew "netcat"
brew "openjdk", link: true
brew "openvpn"
brew "pandoc"
brew "php" unless OS.linux?
brew "planetscale/tap/pscale"
brew "postgresql" unless OS.linux?
brew "pyenv"
brew "pyenv-virtualenv"
# brew "python"
# brew "python@2"
brew "qemu"
brew "rbenv"
# brew "ruby"
brew "ruby-build"
brew "rust"
brew "s3cmd"
brew "sass/sass/dart-sass-embedded"
brew "sass/sass/sass"
brew "shellcheck"
brew "tea"
brew "tor"
brew "torsocks"
brew "wp-cli"
# brew "youtube-dl"
brew "yt-dlp"
# infosec & pentesting
brew "aircrack-ng"
brew "apktool"
brew "bettercap"
brew "binutils"
brew "binwalk"
brew "dnsx"
brew "fcrackzip"
brew "geoip"
brew "hashcat"
brew "httpx"
brew "hydra"
brew "ipinfo-cli"
brew "john"
brew "knock"
brew "massdns"
brew "mitmproxy"
brew "naabu"
brew "nikto"
brew "nmap"
brew "nuclei"
brew "pdfcrack"
brew "pngcheck"
brew "sqlmap"
brew "subfinder"
brew "tcpdump"
brew "tcpflow"
brew "tcpreplay"
brew "tcptrace"
brew "vbindiff"
###############################
# macOS Apps via Cask #
###############################
cask_args appdir: "/Applications"
# System Utilities
cask "airbuddy"
cask "appcleaner"
cask "backblaze"
cask "carbon-copy-cloner"
cask "cleanmymac"
cask "coconutbattery"
cask "daisydisk"
cask "dropbox"
cask "etrecheckpro"
cask "geekbench"
cask "istat-menus"
cask "macupdater"
cask "the-unarchiver"
cask "transmission"
cask "vnc-viewer"
# Passwords, VPNs, other Security
cask "1password"
cask "authy"
cask "gpg-suite"
cask "little-snitch"
# cask "microsoft/git/git-credential-manager-core"
cask "tailscale"
cask "tunnelblick"
# Development/Work
cask "adobe-creative-cloud"
cask "android-platform-tools", args: { appdir: "~/Applications" }
cask "chromedriver"
cask "eclipse-java"
cask "github"
cask "google-cloud-sdk", args: { appdir: "~/Applications" }
cask "imageoptim"
# cask "iterm2"
cask "iterm2-beta"
cask "jetbrains-toolbox"
cask "microsoft-office"
cask "ngrok/ngrok/ngrok"
cask "sequel-pro"
cask "sketch"
cask "tableplus"
cask "thunderbird"
cask "transmit"
cask "visual-studio-code"
# Virtual Machines (& Docker)
cask "docker"
# cask "multipass"
cask "parallels"
cask "vagrant"
# cask "virtualbox"
cask "virtualbox-beta" # supports M1!
# Media
cask "beamer"
cask "handbrake"
cask "iina"
cask "obs"
cask "plex-media-player"
cask "pocket-casts"
cask "spotify"
# Communication/Social
cask "discord"
cask "skype"
cask "slack"
cask "zoomus"
# Pentesting
cask "burp-suite"
cask "charles"
cask "metasploit"
cask "wifi-explorer"
cask "wireshark"
# Browsers
cask "firefox"
cask "firefox-developer-edition"
cask "google-chrome"
cask "tor-browser"
###############################
# Drivers #
###############################
cask "homebrew/cask-drivers/logi-options-plus"
cask "homebrew/cask-drivers/philips-hue-sync"
cask "homebrew/cask-drivers/sonos"
cask "homebrew/cask-drivers/yubico-authenticator"
cask "homebrew/cask-drivers/yubico-yubikey-manager"
###############################
# Fonts #
###############################
# Monospace
cask "homebrew/cask-fonts/font-cascadia-code"
cask "homebrew/cask-fonts/font-hack"
cask "homebrew/cask-fonts/font-roboto-mono"
cask "homebrew/cask-fonts/font-sf-mono"
cask "homebrew/cask-fonts/font-sf-mono-for-powerline"
cask "homebrew/cask-fonts/font-source-code-pro"
# Sans/Serif
cask "homebrew/cask-fonts/font-inter"
cask "homebrew/cask-fonts/font-open-sans"
cask "homebrew/cask-fonts/font-roboto"
cask "homebrew/cask-fonts/font-sf-compact"
cask "homebrew/cask-fonts/font-sf-pro"
###############################
# macOS Apps via App Store #
###############################
# Apple
mas "Apple Configurator 2", id: 1037126344
mas "Compressor", id: 424390742
mas "Developer", id: 640199958
mas "Final Cut Pro", id: 424389933
mas "GarageBand", id: 682658836
mas "iMovie", id: 408981434
mas "Keynote", id: 409183694
mas "Logic Pro", id: 634148309
mas "Motion", id: 434290957
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "TestFlight", id: 899247664
mas "Transporter", id: 1450874784
mas "Xcode", id: 497799835
# Third Party
mas "1Blocker", id: 1365531024
mas "1Password for Safari", id: 1569813296
mas "Amphetamine", id: 937984704
mas "Drafts", id: 1435957248
mas "Magnet", id: 441258766
mas "Microsoft Remote Desktop", id: 1295203466
mas "Shazam", id: 897118787
mas "Silicon Info", id: 1542271266
mas "Speedtest", id: 1153157709
mas "VMware Remote Console", id: 1230249825
mas "WireGuard", id: 1451685025
-21
View File
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019-present Jake Jarvis <jake@jarv.is>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-36
View File
@@ -1,36 +0,0 @@
# 💻 My .files
![iTerm screenshot](misc/screenshot.png)
Just a personal backup of my MacBook's setup. Certainly not a drop-in solution for anybody's machine except my own, but maybe a few lines will prove useful to you.
(...in other words, after stealing so many sick bash hacks from people on here who are much smarter than me, I felt obligated to keep the repo public. And in even more words, **_use the automated scripts at your own risk!_**)
All of the juicy stuff you're probably looking for is at:
- [`zsh/custom/plugins.zsh`](zsh/custom/plugins.zsh), [`zsh/custom/aliases.zsh`](zsh/custom/aliases.zsh), and [`zsh/custom/functions.zsh`](zsh/custom/functions.zsh) for my ZSH hacks.
- [`macos/defaults.sh`](macos/defaults.sh) for my macOS defaults.
- [`Brewfile`](Brewfile) for my far-too-long list of binaries and apps I "need" installed.
- [`firefox/user.js`](firefox/user.js) for my Firefox settings.
- [`vscode/`](vscode/) for my VS Code settings and keybinds.
- See [my /uses page](https://jarv.is/uses/) for even more details.
## Usage
Designed for macOS, also works on Linux (specifially Debian and Ubuntu):
```bash
git clone https://github.com/jakejarvis/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
./install.sh
```
or:
```bash
curl -fsSL jrvs.io/bootstrap | bash # but probably don't do this if you're not me
```
## License
[MIT](LICENSE)
-21
View File
@@ -1,21 +0,0 @@
{
"auths": {
"gcr.io": {},
"ghcr.io": {},
"https://index.docker.io/v1/": {}
},
"credsStore": "desktop",
"credHelpers": {
"194055617947.dkr.ecr.us-east-1.amazonaws.com" : "ecr-login",
"public.ecr.aws" : "ecr-login",
"asia.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"us.gcr.io": "gcloud"
},
"experimental": "enabled",
"stackOrchestrator": "swarm",
"currentContext": "desktop-linux"
}
-21
View File
@@ -1,21 +0,0 @@
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"dns": [
"1.1.1.1",
"1.0.0.1"
],
"experimental": true,
"features": {
"buildkit": true
},
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "5"
}
}
-3
View File
@@ -1,3 +0,0 @@
{
"composeV2": "enabled"
}
+25 -15
View File
@@ -22,9 +22,20 @@ elif [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
# fnm
if command -v fnm &>/dev/null; then
eval "$(fnm env --use-on-cd --shell bash)"
# go
if [[ -d "$HOME/golang" ]]; then
export GOPATH="$HOME/golang"
path=("$GOPATH/bin" $path)
fi
# rust/cargo
if [[ -d "$HOME/.cargo" ]]; then
path=("$HOME/.cargo/bin" $path)
fi
# mise
if command -v mise &>/dev/null; then
eval "$(mise activate bash)"
fi
# rbenv
@@ -32,18 +43,17 @@ if command -v rbenv &>/dev/null; then
eval "$(rbenv init - --no-rehash bash)"
fi
# pyenv
if command -v pyenv &>/dev/null; then
eval "$(pyenv init - --no-rehash bash)"
# pyenv-virtualenv
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
if command -v pyenv-virtualenv-init &>/dev/null; then
eval "$(pyenv virtualenv-init -)"
fi
# pnpm
if [[ -d "$HOME/.local/share/pnpm" ]]; then
path=("$HOME/.local/share/pnpm" $path)
fi
# pyenv-virtualenv
if command -v pyenv-virtualenv-init &>/dev/null; then
eval "$(pyenv virtualenv-init -)"
# bun
if [[ -d "$HOME/.cache/.bun" ]]; then
path=("$HOME/.cache/.bun/bin" $path)
fi
# uv, apparently?
if [[ -d "$HOME/.local/bin" ]]; then
path=("$HOME/.local/bin" $path)
fi
+60
View File
@@ -0,0 +1,60 @@
# Ghostty config translated from iTerm2
# https://ghostty.org/docs/config
# Font settings
font-family = "Monaspace Neon"
font-size = 12
adjust-cell-height = 4
# Window settings
window-width = 160
window-height = 48
background-opacity = 0.93
background-blur = true
# Cursor (bar style, matching iTerm2 cursor type 1)
cursor-style = bar
# Shell
command = /opt/homebrew/bin/zsh
# Scrollback (unlimited)
scrollback-limit = 10000000
# Option key behavior (left=esc, right=normal)
macos-option-as-alt = left
# Colors
theme = Material Darker
#background = none
# background = #141414
# foreground = #edf0eb
# cursor-color = #eaeaea
# selection-background = #bcc085
# selection-foreground = #141414
# # ANSI colors (normal)
# palette = 0=#000000
# palette = 1=#ff5c57
# palette = 2=#5af78e
# palette = 3=#f3f99d
# palette = 4=#57c7ff
# palette = 5=#ff6ac1
# palette = 6=#9aedfe
# palette = 7=#f1f1f0
# # ANSI colors (bright)
# palette = 8=#000000
# palette = 9=#ff5c57
# palette = 10=#5af78e
# palette = 11=#f3f99d
# palette = 12=#57c7ff
# palette = 13=#ff6ac1
# palette = 14=#9aedfe
# palette = 15=#f1f1f0
# Other settings matching iTerm2
copy-on-select = false
# confirm-close-surface = false
shell-integration-features = true
+12
View File
@@ -0,0 +1,12 @@
[settings]
idiomatic_version_file_enable_tools = ["node"]
[settings.python]
compile = false
[tools]
bun = "latest"
node = "24"
python = ["3.14", "3.13", "3.12", "3.11"]
ruby = "latest"
uv = "latest"
+5
View File
@@ -0,0 +1,5 @@
@biomejs/biome
eslint
prettier
turbo
vercel
+16 -17
View File
@@ -1,30 +1,32 @@
[core]
editor = code --wait
pager = delta
excludesfile = ~/.gitignore
excludesfile = ~/.gitignore_global
{{ if eq .chezmoi.os "darwin" }}
# Make `git rebase` safer on macOS
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
{{ end }}
[user]
email = jake@jarv.is
name = Jake Jarvis
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHeuNlSZmqygM4XN7++pmfrNUsFzAjlxaYHoO/JXVdT5
email = {{ .user.git.email | quote }}
name = {{ .user.git.name | quote }}
signingkey = {{ .user.git.signingkey | quote }}
[gpg]
format = ssh
{{ if eq .chezmoi.os "darwin" }}
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
[credential "https://github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
{{ end }}
[init]
defaultBranch = main
[push]
default = tracking
gpgSign = if-asked
[pull]
rebase = true
[commit]
@@ -36,12 +38,9 @@
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[interactive]
diffFilter = delta --color-only --features=interactive
[alias]
undo = reset --soft HEAD~1
pom = push origin main
# Show verbose output about tags, branches, remotes, aliases and contributors
tags = tag -l
branches = branch -a
@@ -49,10 +48,6 @@
aliases = config --get-regexp alias
contributors = shortlog --summary --numbered
new = !git init && git symbolic-ref HEAD refs/heads/main
[github]
user = jakejarvis
[hub]
host = github.com
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
@@ -62,6 +57,9 @@
keepBackup = true
[color]
ui = auto
{{ if lookPath "delta" }}
[interactive]
diffFilter = delta --color-only --features=interactive
[delta]
features = decorations
[delta "interactive"]
@@ -70,3 +68,4 @@
hunk-header-style = omit
line-numbers = true
syntax-theme = base16
{{ end }}
@@ -34,3 +34,5 @@ Temporary Items
# allow
!.gitkeep
.claude/*.local.*
+4 -4
View File
@@ -1,15 +1,15 @@
# Enable built-in syntax highlighting
{{ if eq .chezmoi.os "darwin" }}
include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc"
{{ else }}
include "/usr/share/nano/*.nanorc"
{{ end }}
# Non-default settings
set historylog # Save the last 100 history searches for later use.
# set positionlog # Saves the cursor position between editing sessions.
set zap # Allows you to highlight text (CTRL+SHIFT+ARROW) and delete it with backspace.
set afterends # Ctrl+Right moves to end of word instead of beginning.
set wordchars "_" # Recognize _ as part of a word.
set autoindent # A new line will have the same number of tabs/leading spaces as the previous one.
# set tabsize 2
# set tabstospaces
# Fix option+left/right word skipping
# https://unix.stackexchange.com/a/392309
+714
View File
@@ -0,0 +1,714 @@
#!/usr/bin/env zsh
# set DOTFILES_DEBUG to trace startup times (1/2)
[[ "$DOTFILES_DEBUG" != "1" ]] || zmodload zsh/zprof
###########################
# Config
###########################
autoload -U colors && \
colors
autoload -Uz select-word-style && \
select-word-style bash
# autoload -Uz bracketed-paste-magic && \
# zle -N bracketed-paste bracketed-paste-magic
# zstyle ':bracketed-paste-magic' active-widgets '.self-*'
autoload -Uz url-quote-magic && \
zle -N self-insert url-quote-magic
zstyle ":urlglobber" url-other-schema ftp git gopher http https magnet && \
export DISABLE_MAGIC_FUNCTIONS=true # make pasting into terminal faster
# enable bash-like 'help' command for zsh:
# https://stackoverflow.com/questions/4405382/how-can-i-read-documentation-about-built-in-zsh-commands
unalias run-help 2>/dev/null
autoload run-help
alias help=run-help
# ---
setopt notify
setopt complete_aliases
# setopt complete_in_word
# setopt always_to_end
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt share_history
setopt inc_append_history
setopt rc_quotes
setopt extended_glob
setopt glob_dots
unsetopt case_glob
unsetopt beep # kindly stfu
unsetopt list_beep
unsetopt correct
unsetopt correct_all
# ---
export LC_ALL="${LC_ALL:-en_US.UTF-8}"
export LANG="${LANG:-en_US.UTF-8}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export HISTFILE="${HISTFILE:-$HOME/.zsh_history}"
export HISTSIZE=10000
export SAVEHIST=10000
export EDITOR="nano" # don't judge me
export VISUAL="cursor --wait"
export PAGER="less"
export LESS="$LESS -RF --mouse --silent"
# resolve GPG terminal at shell runtime
# fixes "signing failed: Inappropriate ioctl for device"
if tty -s 2>/dev/null; then
GPG_TTY=$(tty)
export GPG_TTY
fi
#export BROWSER="/Applications/Firefox.app/Contents/MacOS/firefox"
export BROWSER="/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser"
# https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client
if [[ -S "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" ]]; then
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
fi
export HOMEBREW_CASK_OPTS="--appdir=/Applications" # --require-sha
export HOMEBREW_FORCE_BREWED_CURL=1
export HOMEBREW_FORCE_BREWED_GIT=1
###########################
# Env vars
###########################
# homebrew tweaks
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSECURE_REDIRECT=1
# docker tweaks
export DOCKER_BUILDKIT=1
export DOCKER_SCAN_SUGGEST=false
export COMPOSE_DOCKER_CLI_BUILD=1
# npm tweaks
export DISABLE_OPENCOLLECTIVE=1
export NO_UPDATE_NOTIFIER=1
export NPM_CONFIG_FUND=false
export NPM_CONFIG_UPDATE_NOTIFIER=false
export OPEN_SOURCE_CONTRIBUTOR=true
export OPENCOLLECTIVE_HIDE=1
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export MISE_NODE_COREPACK=1
# can everyone stop being so creepy pls
export AZURE_CORE_COLLECT_TELEMETRY=0
export CHECKPOINT_DISABLE=1
export CLI_COLLECT_METRICS=0
export CLOUDSDK_CORE_DISABLE_USAGE_REPORTING=true
export DOTNET_CLI_TELEMETRY_OPTOUT=true
export GATSBY_TELEMETRY_DISABLED=1
export NEXT_TELEMETRY_DISABLED=1
export POWERSHELL_TELEMETRY_OPTOUT=1
export SAM_CLI_TELEMETRY=0
export SLS_TELEMETRY_DISABLED=1
export VAGRANT_CHECKPOINT_DISABLE=1
export YARN_ENABLE_TELEMETRY=0
###########################
# Path
###########################
# Homebrew's location is different depending on OS...
# https://github.com/Homebrew/install/blob/master/install.sh#L122
if [[ -d /opt/homebrew ]]; then
# macOS on Apple Silicon
BREW_BIN="/opt/homebrew/bin/brew"
elif [[ -d "$HOME/.linuxbrew" ]]; then
# Linux, user install
# NOTE: definitely discouraged, maybe deprecated? https://github.com/Homebrew/install/pull/702
BREW_BIN="$HOME/.linuxbrew/bin/brew"
elif [[ -d /home/linuxbrew/.linuxbrew ]]; then
# Linux, system install
BREW_BIN="/home/linuxbrew/.linuxbrew/bin/brew"
else
# macOS on Intel (hopefully, or else we're kinda doomed...)
BREW_BIN="/usr/local/bin/brew"
fi
# set PATHs for Homebrew (if we found it)
if [[ -x "$BREW_BIN" ]]; then
eval "$("$BREW_BIN" shellenv)"
fi
# go
if [[ -d "$HOME/golang" ]]; then
export GOPATH="$HOME/golang"
path=("$GOPATH/bin" $path)
fi
# rust/cargo
if [[ -d "$HOME/.cargo" ]]; then
path=("$HOME/.cargo/bin" $path)
fi
# mise
if command -v mise &>/dev/null; then
eval "$(mise activate zsh)"
fi
# rbenv
if command -v rbenv &>/dev/null; then
eval "$(rbenv init - --no-rehash zsh)"
fi
# bun
if [[ -d "$HOME/.cache/.bun" ]]; then
path=("$HOME/.cache/.bun/bin" $path)
fi
# uv, apparently?
if [[ -d "$HOME/.local/bin" ]]; then
path=("$HOME/.local/bin" $path)
fi
# docker user mode, see: https://docs.docker.com/desktop/mac/permission-requirements/#installing-symlinks
if [[ -d "$HOME/.docker/bin" ]]; then
path=("$HOME/.docker/bin" $path)
fi
if [[ -d "$HOME/.orbstack" ]]; then
source "$HOME/.orbstack/shell/init.zsh" 2>/dev/null || :
fi
if [[ -d "$HOME/.opencode" ]]; then
path=("$HOME/.opencode/bin" $path)
fi
# let zsh sort out formatting and deduplication
typeset -aU path fpath manpath
export PATH FPATH MANPATH
###########################
# Aliases
###########################
# allow sudo-able aliases
alias sudo="sudo "
# colorful ls
alias ls="ls -G --color=auto"
alias ll="ls -lah"
alias la="ls -a"
alias l="ll"
# easier dotfile tinkering
alias shreload="exec \$SHELL"
alias shdebug="DOTFILES_DEBUG=1 exec \$SHELL"
# git
alias g="git"
alias gc="git commit -m" # + commit message
alias gca="git add . && git commit -m" # + commit message
alias gs="git status -sb"
alias gl="git log --pretty=short"
alias gd="git diff"
alias gds="git diff --staged"
alias gpom="git push origin main"
alias glom="git pull origin main"
alias gpo="git push origin" # + branch name
alias glo="git pull origin" # + branch name
alias glfm="git fetch && git reset origin/main --hard"
alias gb="git checkout" # + existing branch name
alias gbn="git checkout -b" # + new branch name
alias grm="git rebase -i origin/main"
alias gsub="git submodule update --recursive --remote"
alias gundo="git reset --soft HEAD~1"
alias gres="git reset"
alias github="gh repo view --web"
alias gist="gh gist create --web"
# docker
alias dps="docker ps -a"
dbar() {
# build a Dockerfile in the current directory and run it interactively:
# https://stackoverflow.com/questions/45141402/build-and-run-dockerfile-with-one-command/59220656#59220656
docker run --rm -it "$(docker build --no-cache -q .)"
}
dsh() {
docker exec -it "$1" /bin/sh
}
# alias dc="docker-compose"
alias dc="docker compose"
alias dcu="dc up -d"
alias dcd="dc down"
alias dcr="dcd && dcu"
alias dcl="dc logs -f"
# Node/NPM/Yarn
alias npr="npm run"
alias yar="yarn run"
alias pnpr="pnpm run"
alias fresh_npm="rm -rf node_modules package-lock.json && npm install"
alias fresh_yarn="rm -rf node_modules yarn.lock && yarn install"
alias fresh_pnpm="rm -rf node_modules pnpm-lock.yaml && pnpm install"
# open current working directory in VS Code
alias vs="code ."
# an original creation, see https://github.com/jakejarvis/simpip
alias ipv4="curl -4 simpip.com --max-time 1 --proto-default https --silent"
alias ipv6="curl -6 simpip.com --max-time 1 --proto-default https --silent"
alias ip="ipv4; ipv6"
alias ip-local="ipconfig getifaddr en0"
alias ips="ip; ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# youtube-dl
alias youtube-dl="yt-dlp" # better youtube-dl fork: https://github.com/yt-dlp/yt-dlp
alias ytdl="youtube-dl -f bestvideo+bestaudio"
alias ytmp3="youtube-dl -f bestaudio -x --audio-format mp3 --audio-quality 320K"
# misc.
alias screenfetch="neofetch"
alias weather="curl 'https://wttr.in/?format=v2'"
# mac shortcuts
alias unhidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias rehidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
alias force_empty="sudo rm -rf ~/.Trash \"/Volumes/*/.Trashes\""
alias unq="sudo xattr -rd com.apple.quarantine"
# hide/show all desktop icons (useful when presenting)
alias hidedesk="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesk="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias ripfinder="killall Finder"
alias ripdock="killall Dock"
alias ripmenu="killall SystemUIServer NotificationCenter"
# open current directory in Finder
alias finder="open -a Finder ."
alias dns-clear="networksetup -setdnsservers Wi-Fi"
alias dns-check="networksetup -getdnsservers Wi-Fi"
alias dns-set="networksetup -setdnsservers Wi-Fi "
alias dns-set-cloudflare="dns-set 1.1.1.1 1.0.0.1"
alias dns-set-google="dns-set 8.8.8.8 8.8.4.4"
alias flush="sudo killall -HUP mDNSResponder; sudo killall mDNSResponderHelper; sudo dscacheutil -flushcache"
# Xcode simulators
alias ios_sim="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"
alias watchos_sim="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator\ \(Watch\).app"
# convenient access to ssh public key
alias pubkey="pbcopy < ~/.ssh/id_ed25519.pub && echo '=> Public key copied to clipboard.'"
# workaround for lack of tailscale CLI on mac:
# https://tailscale.com/kb/1080/cli/?tab=macos#using-the-cli
alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
###########################
# Functions
###########################
system_update() {
local NC="\033[0m"
local YELLOW="\033[0;33m"
# homebrew
echo -e "${YELLOW}Updating Homebrew formulae and casks...${NC}"
brew update
brew upgrade
# avoid annoying `(latest) != latest` cask updates:
brew upgrade $(brew outdated --greedy --verbose | awk '$2 !~ /(latest)/ {print $1}')
brew cleanup
# node, npm, yarn
# echo -e "${YELLOW}Updating global NPM/Yarn packages...${NC}"
# fnm install --latest --corepack-enabled
# npm update --global --no-audit
# ruby, gems
echo -e "${YELLOW}Updating Ruby and gems...${NC}"
CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS" \
rbenv install --skip-existing "$(rbenv install -l | grep -v - | tail -1)" && \
rbenv global "$(rbenv install -l | grep -v - | tail -1)"
gem install bundler foreman
gem update
gem cleanup
rbenv rehash
# pips
# https://stackoverflow.com/a/3452888
echo -e "${YELLOW}Updating pip packages...${NC}"
pip3 list --outdated --format=json | jq -r '.[] | .name+"="+.latest_version' | cut -d = -f 1 | xargs -n1 pip3 install -U
# zinit & plugins
echo -e "${YELLOW}Updating zinit...${NC}"
zinit self-update
zinit update --all
# App Store
echo -e "${YELLOW}Checking for App Store updates...${NC}"
mas outdated
# macOS system
echo -e "${YELLOW}Checking for macOS system updates...${NC}"
softwareupdate --list
}
# Make a new directory and `cd` right into it
mkcd() {
mkdir -p "$1" && cd "$1"
}
# Start an HTTP server from a directory, optionally specifying the port
serve() {
local port="${1:-8090}"
sleep 1 && open "http://localhost:${port}/" &
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesn't break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
}
###########################
# Plugins
###########################
# these custom values must be set *before* sourcing zinit
export ZINIT_HOME="${ZINIT_HOME:-"${XDG_DATA_HOME:-"${HOME}/.local/share"}/zinit/zinit.git"}"
declare -A ZINIT=(
[ZCOMPDUMP_PATH]="${XDG_CACHE_HOME:-"$HOME/.cache"}/zsh/.zcompdump-$ZSH_VERSION"
)
# check for zinit
if [[ -f "$ZINIT_HOME/zinit.zsh" ]]; then
source "$ZINIT_HOME/zinit.zsh"
else
echo "zinit not found in '$ZINIT_HOME', either check the value of ZINIT_HOME or install zinit."
return
fi
# initialize zinit && ensure compinit recognizes its completions
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# TODO: figure out why zinit stopped adding itself to MANPATH automatically...
if [[ -d "${ZINIT[MAN_DIR]}" ]]; then
manpath=(
"${ZINIT[MAN_DIR]}"
$manpath
)
fi
# various zinit add-ons
zinit light zdharma-continuum/zinit-annex-patch-dl
# oh-my-zsh was good at setting iTerm tab titles, keep doing it pls
# https://github.com/ohmyzsh/ohmyzsh/tree/master/lib
zinit snippet OMZ::lib/functions.zsh
zinit snippet OMZ::lib/termsupport.zsh
zinit snippet OMZ::lib/compfix.zsh
# async support
zinit ice lucid depth"1" \
atload"async_init" \
src"async.zsh"
zinit light mafredri/zsh-async
# grab exa (better ls) binary
zinit ice lucid from"gh-r" as"command" \
mv"bin/exa* -> exa" \
atclone"
mv -vf completions/exa.zsh _exa
mv -vf man/exa.1 ${ZINIT[MAN_DIR]}/man1
mv -vf man/exa_colors.5 ${ZINIT[MAN_DIR]}/man5
" \
atpull"%atclone" \
atload"
alias ls='exa --color=auto -GF --icons --group-directories-first'
alias ll='exa --color=auto -1laF --git --icons --group-directories-first --ignore-glob=\".DS_Store*|~*\"'
alias lt='ll -T -L=2'
"
zinit light ogham/exa
# grab bat (better cat) binary
zinit ice lucid from"gh-r" as"command" \
mv"bat-*/bat -> bat" \
atclone"
mv -vf bat-*/autocomplete/bat.zsh _bat
mv -vf bat-*/bat.1 ${ZINIT[MAN_DIR]}/man1
" \
atpull"%atclone" \
atload"
export BAT_THEME='base16'
export MANPAGER='sh -c \"col -bx | bat --color=always --style=plain --language=man\"'
#alias cat='bat --paging=always --color=auto --style=numbers,changes'
alias plcat='bat --paging=never --color=auto --style=plain'
"
zinit light sharkdp/bat
# grab delta binary
zinit ice lucid from"gh-r" as"command" \
mv"delta-*/delta -> delta" \
dl"https://github.com/dandavison/delta/raw/HEAD/etc/completion/completion.zsh -> _delta"
zinit light dandavison/delta
# grab fd binary
zinit ice lucid from"gh-r" as"command" \
mv"fd-*/fd -> fd" \
atclone"
mv -vf fd-*/autocomplete/_fd _fd
mv -vf fd-*/fd.1 ${ZINIT[MAN_DIR]}/man1
" \
atpull"%atclone"
zinit light sharkdp/fd
# grab fzf binary from release & other files from source
# TODO: preview commands are an absolute sh*tshow, maybe use .lessfilter?
# https://github.com/Aloxaf/fzf-tab/wiki/Preview#show-file-contents
zinit ice lucid from"gh-r" as"command" \
dl"https://github.com/junegunn/fzf/raw/HEAD/shell/key-bindings.zsh -> key-bindings.zsh" \
dl"https://github.com/junegunn/fzf/raw/HEAD/shell/completion.zsh -> _fzf" \
dl"https://github.com/junegunn/fzf/raw/HEAD/man/man1/fzf.1 -> ${ZINIT[MAN_DIR]}/man1/fzf.1" \
dl"https://github.com/junegunn/fzf/raw/HEAD/man/man1/fzf-tmux.1 -> ${ZINIT[MAN_DIR]}/man1/fzf-tmux.1" \
atload'
export FZF_FD_OPTS="--color always --hidden --follow --exclude .git --exclude node_modules"
export FZF_PREVIEW_FILE_COMMAND="bat --color=always --paging=never --style=plain"
export FZF_PREVIEW_DIR_COMMAND="exa -1a --color=always --icons --group-directories-first"
export FZF_DEFAULT_OPTS="--cycle --select-1 --exit-0 --height=60% --no-mouse --bind=\"tab:accept,ctrl-y:preview-page-up,ctrl-v:preview-page-down,ctrl-e:execute-silent(\${VISUAL:-\$EDITOR} {+} >/dev/null 2>&1)\""
export FZF_DEFAULT_COMMAND="fd --type f $FZF_FD_OPTS"
export FZF_ALT_C_OPTS="-i --ansi --preview=\"$FZF_PREVIEW_DIR_COMMAND {}\""
export FZF_ALT_C_COMMAND="fd --type d . $FZF_FD_OPTS"
export FZF_CTRL_T_OPTS="-i --ansi --bind=\"ctrl-w:execute(\$EDITOR {1} >/dev/tty </dev/tty)+refresh-preview\" --preview=\"$FZF_PREVIEW_FILE_COMMAND {} 2>/dev/null\""
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
' \
src"key-bindings.zsh"
zinit light junegunn/fzf
# zoxide
# zinit ice wait"0b" lucid from"gh-r" as"command" \
# atclone"
# mv -vf man/man1/zoxide* ${ZINIT[MAN_DIR]}/man1
# ./zoxide init zsh > init.zsh
# zcompile init.zsh
# " \
# atpull"%atclone" \
# atinit'
# export _ZO_DATA_DIR="${XDG_DATA_HOME:-"$HOME/.local/share"}/zoxide"
# export _ZO_FZF_OPTS="$FZF_DEFAULT_OPTS --exact --no-sort --ansi --reverse --preview=\"$FZF_PREVIEW_DIR_COMMAND {2..}\""
# ' \
# src"init.zsh"
# zinit light ajeetdsouza/zoxide
# grab vivid binary (for all the colors)
# https://github.com/sharkdp/vivid/tree/master/themes
# by outputting the generated LS_COLORS variable to a file and sourcing it, we only need to call vivid once on
# installation rather than every time a new session begins.
zinit ice lucid from"gh-r" as"command" \
mv"vivid-*/vivid -> vivid" \
atclone"
./vivid generate snazzy | xargs printf 'export LS_COLORS=%q' > colors.zsh
" \
atpull"%atclone" \
atload"zstyle ':completion:*' list-colors \${(s.:.)LS_COLORS}" \
src"colors.zsh"
zinit light sharkdp/vivid
# better Ctrl+R history searching
# zinit ice wait lucid depth"1" \
# atload"
# zstyle ':history-search-multi-word' highlight-color 'fg=yellow,bold'
# zstyle ':history-search-multi-word' page-size 15
# zstyle ':plugin:history-search-multi-word' active 'standout'
# zstyle ':plugin:history-search-multi-word' reset-prompt-protect 1
# " \
# trackbinds
# zinit light zdharma-continuum/history-search-multi-word
# tab completions via fzf
zinit ice wait"0b" lucid depth"1" \
has"fzf" \
blockf \
atpull"zinit creinstall -q ." \
atload"
zstyle ':completion:*' verbose true
zstyle ':completion:*' cache-path '$(dirname ${ZINIT[ZCOMPDUMP_PATH]})/.zcompcache'
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*:descriptions' format '%d'
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion::complete:*:*:files' ignored-patterns '.DS_Store' 'Icon?'
zstyle ':completion::complete:*:*:globbed-files' ignored-patterns '.DS_Store' 'Icon?'
zstyle ':completion::complete:rm:*:globbed-files' ignored-patterns
zstyle ':fzf-tab:*' fzf-command 'fzf'
zstyle ':fzf-tab:*' fzf-flags $FZF_DEFAULT_OPTS '-i' '--ansi'
zstyle ':fzf-tab:*' fzf-bindings \
'tab:accept' \
'ctrl-y:preview-page-up' \
'ctrl-v:preview-page-down' \
'ctrl-e:execute-silent(\${VISUAL:-\$EDITOR} \$realpath >/dev/null 2>&1)' \
'ctrl-w:execute(\$EDITOR \$realpath >/dev/tty </dev/tty)+refresh-preview'
zstyle ':fzf-tab:*' fzf-min-height 15
zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-preview \
'git diff --no-ext-diff \$word | delta --paging=never --no-gitconfig --line-numbers --file-style=omit --hunk-header-style=omit --theme=base16'
zstyle ':fzf-tab:complete:git-log:*' fzf-preview \
'git --no-pager log --color=always --format=oneline --abbrev-commit --follow \$word'
zstyle ':fzf-tab:complete:man:*' fzf-preview \
'man -P \"col -bx\" \$word | $FZF_PREVIEW_FILE_COMMAND --language=man'
zstyle ':fzf-tab:complete:brew-(install|uninstall|search|info):*-argument-rest' fzf-preview \
'brew info \$word'
zstyle ':fzf-tab:complete:*:options' fzf-preview
zstyle ':fzf-tab:complete:*:options' fzf-flags '--no-preview'
zstyle ':fzf-tab:complete:*:argument-1' fzf-preview
zstyle ':fzf-tab:complete:*:argument-1' fzf-flags '--no-preview'
zstyle ':fzf-tab:complete:*:*' fzf-preview \
'($FZF_PREVIEW_FILE_COMMAND \$realpath || $FZF_PREVIEW_DIR_COMMAND \$realpath) 2>/dev/null'
"
zinit light Aloxaf/fzf-tab
# zstyle ':fzf-tab:complete:(-command-|-parameter-|-brace-parameter-|export|unset|expand):*' fzf-preview \
# 'echo \${(P)word}'
# fix git-* completions, apparently there's some conflict with brew's git
# TODO: investigate more... https://github.com/Aloxaf/fzf-tab/wiki/Preview#git
zinit ice wait lucid as"null" \
atload'zstyle ":completion:*:*:git:*" script "$(pwd)/git-completion.bash"'
zinit snippet https://github.com/git/git/raw/HEAD/contrib/completion/git-completion.bash
# grab completions as snippets from GitHub repos
zinit wait lucid as"completion" \
atpull"zinit creinstall -q ." \
nocompile \
for \
has"node" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_node \
has"psql" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_pgsql_utils \
has"rails" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_rails \
has"git" mv"git-completion.zsh -> _git" https://github.com/git/git/raw/HEAD/contrib/completion/git-completion.zsh
# generate other completions from externally installed programs
zinit wait lucid as"completion" \
atpull"zinit creinstall -q ." \
nocompile \
for \
has"docker" id-as"_local/completions/docker" atclone"docker completion zsh > _docker" zdharma-continuum/null \
has"gh" id-as"_local/completions/gh" atclone"gh completion -s zsh > _gh" zdharma-continuum/null \
has"hugo" id-as"_local/completions/hugo" atclone"hugo completion zsh > _hugo" zdharma-continuum/null \
has"mise" id-as"_local/completions/mise" atclone"mise completion zsh > _mise" zdharma-continuum/null \
has"op" id-as"_local/completions/op" atclone"op completion zsh > _op" zdharma-continuum/null \
has"pip" id-as"_local/completions/pip" atclone"pip completion --zsh > pip" zdharma-continuum/null \
has"pnpm" id-as"_local/completions/pnpm" atclone"pnpm completion zsh > _pnpm" zdharma-continuum/null \
has"tailscale" id-as"_local/completions/tailscale" atclone"tailscale completion zsh > _tailscale" zdharma-continuum/null
# macOS-only completion fixes
zinit ice wait lucid as"null" \
id-as"_local/extra/mac" \
if'[[ "$OSTYPE" = darwin* ]]' \
atload"
zstyle ':completion:*:*:*:*:processes' command 'ps -o comm=\"\" -w -w'
zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \
'[[ \$group == \"process ID\" ]] && ps -p\$word -o comm=\"\" -w -w'
"
zinit light zdharma-continuum/null
# Linux-only completion fixes
zinit ice wait lucid as"null" \
id-as"_local/extra/linux" \
if'[[ "$OSTYPE" = linux-gnu* ]]' \
atload"
zstyle ':completion:*:*:*:*:processes' command 'ps -o cmd --no-headers -w -w'
zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \
'[[ \$group == \"process ID\" ]] && ps --pid=\$word -o cmd --no-headers -w -w'
zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status \$word'
"
zinit light zdharma-continuum/null
# autopairing of quotes, brackets, etc.
zinit ice wait"0b" lucid depth"1" \
atload"ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(autopair-insert)"
zinit light hlissner/zsh-autopair
# syntax highlighting
zinit ice wait lucid depth"1" \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
atload"
zle_highlight+=('paste:reverse')
zstyle ':plugin:fast-syntax-highlighting' theme ''
typeset -gA FAST_HIGHLIGHT_STYLES
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME:-}variable]='fg=cyan,bold'
"
zinit light zdharma-continuum/fast-syntax-highlighting
# autosuggestions, trigger precmd hook upon load
zinit ice wait"0a" lucid depth"1" \
atinit"
export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
export ZSH_AUTOSUGGEST_MANUAL_REBIND=1
export ZSH_AUTOSUGGEST_USE_ASYNC=1
" \
atload"_zsh_autosuggest_start"
zinit light zsh-users/zsh-autosuggestions
# 1Password plugins: https://developer.1password.com/docs/cli/shell-plugins/
# NOTE: this needs to happen *after* generating the completions above, otherwise it'll ask for touch ID to do very
# simple tasks...
zinit ice wait"1" lucid \
id-as"_local/op-auth" \
has"op" \
if"[[ -f ~/.config/op/plugins.sh ]]" \
nocompile
zinit snippet ~/.config/op/plugins.sh
# iTerm2 integration
zinit ice lucid depth"1" \
if'[[ "$TERM_PROGRAM" = "iTerm.app" ]]' \
atload'path=("$(pwd)/utilities" $path)' \
src"shell_integration/zsh" \
nocompile
zinit light gnachman/iTerm2-shell-integration
# starship prompt
zinit ice from"gh-r" as"command" \
atclone"
./starship completions zsh > _starship
./starship init zsh --print-full-init > init.zsh
zcompile init.zsh
" \
atpull"%atclone" \
src"init.zsh"
zinit light starship/starship
##############################
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
fpath=(/Users/jake/.docker/completions $fpath)
autoload -Uz compinit
compinit
# End of Docker CLI completions
if [[ -f ~/.zshrc.local ]]; then
source ~/.zshrc.local
fi
# uncomment to debug startup time (2/2)
[[ "$DOTFILES_DEBUG" != "1" ]] || zprof
View File
-180
View File
@@ -1,180 +0,0 @@
user_pref("accessibility.force_disabled", 1);
user_pref("app.normandy.enabled", false);
user_pref("app.normandy.first_run", false);
user_pref("app.shield.optoutstudies.enabled", false);
user_pref("beacon.enabled", false);
user_pref("breakpad.reportURL", "");
user_pref("browser.aboutConfig.showWarning", false);
user_pref("browser.contentblocking.category", "custom");
user_pref("browser.contentblocking.report.hide_vpn_banner", true);
user_pref("browser.contentblocking.report.lockwise.enabled", false);
user_pref("browser.contentblocking.report.show_mobile_app", false);
user_pref("browser.contentblocking.report.vpn-promo.url", "");
user_pref("browser.contentblocking.report.vpn.enabled", false);
user_pref("browser.contentblocking.reportBreakage.enabled", false);
user_pref("browser.contentblocking.reportBreakage.url", "");
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
user_pref("browser.crashReports.unsubmittedCheck.enabled", false);
user_pref("browser.ctrlTab.recentlyUsedOrder", false);
user_pref("browser.discovery.enabled", false);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.formfill.enable", false);
user_pref("browser.newtabpage.activity-stream.asrouter.disable-captive-portal-vpn-promo", true);
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);
user_pref("browser.newtabpage.activity-stream.default.sites", "");
user_pref("browser.newtabpage.activity-stream.discoverystream.enabled", false);
user_pref("browser.newtabpage.activity-stream.discoverystream.personalization.enabled", false);
user_pref("browser.newtabpage.activity-stream.discoverystream.spocs.personalized", false);
user_pref("browser.newtabpage.activity-stream.discoverystream.sponsored-collections.enabled", false);
user_pref("browser.newtabpage.activity-stream.feeds.recommendationprovider", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
user_pref("browser.newtabpage.activity-stream.feeds.system.topsites", false);
user_pref("browser.newtabpage.activity-stream.feeds.system.topstories", false);
user_pref("browser.newtabpage.activity-stream.feeds.systemtick", false);
user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false);
user_pref("browser.newtabpage.activity-stream.feeds.topsites", false);
user_pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines", "");
user_pref("browser.newtabpage.activity-stream.section.highlights.includeBookmarks", false);
user_pref("browser.newtabpage.activity-stream.section.highlights.includeDownloads", false);
user_pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);
user_pref("browser.newtabpage.activity-stream.section.highlights.includeVisited", false);
user_pref("browser.newtabpage.activity-stream.showSponsored", false);
user_pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false);
user_pref("browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint", "");
user_pref("browser.newtabpage.activity-stream.telemetry", false);
user_pref("browser.pagethumbnails.capturing_disabled", true);
user_pref("browser.partnerlink.attributionURL", "");
user_pref("browser.partnerlink.campaign.topsites", "");
user_pref("browser.ping-centre.telemetry", false);
user_pref("browser.places.speculativeConnect.enabled", false);
user_pref("browser.preferences.moreFromMozilla", false);
user_pref("browser.promo.focus.enabled", false);
user_pref("browser.safebrowsing.downloads.enabled", false);
user_pref("browser.safebrowsing.downloads.remote.block_dangerous_host", false);
user_pref("browser.safebrowsing.downloads.remote.block_dangerous", false);
user_pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false);
user_pref("browser.safebrowsing.downloads.remote.block_uncommon", false);
user_pref("browser.safebrowsing.downloads.remote.enabled", false);
user_pref("browser.safebrowsing.downloads.remote.url", "");
user_pref("browser.safebrowsing.malware.enabled", false);
user_pref("browser.safebrowsing.phishing.enabled", false);
user_pref("browser.safebrowsing.provider.google.updateURL", "");
user_pref("browser.safebrowsing.provider.google4.dataSharingURL", "");
user_pref("browser.safebrowsing.provider.google4.gethashURL", "");
user_pref("browser.safebrowsing.provider.google4.updateURL", "");
user_pref("browser.send_pings", false);
user_pref("browser.shell.checkDefaultBrowser", false);
user_pref("browser.shell.defaultBrowserCheckCount", 1);
user_pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
user_pref("browser.tabs.crashReporting.sendReport", false);
user_pref("browser.tabs.warnOnClose", true);
user_pref("browser.uitour.enabled", false);
user_pref("browser.urlbar.eventTelemetry.enabled", false);
user_pref("browser.urlbar.speculativeConnect.enabled", false);
user_pref("browser.urlbar.sponsoredTopSites", false);
user_pref("browser.urlbar.suggest.calculator", true);
user_pref("browser.urlbar.trimURLs", false);
user_pref("browser.vpn_promo.enabled", false);
user_pref("browser.xul.error_pages.expert_bad_cert", true);
user_pref("captivedetect.canonicalURL", "");
user_pref("datareporting.healthreport.uploadEnabled", false);
user_pref("datareporting.policy.dataSubmissionEnabled", false);
user_pref("device.sensors.enabled", false);
user_pref("dom.battery.enabled", false);
user_pref("dom.disable_window_move_resize", true);
user_pref("dom.enable_performance", false);
user_pref("dom.enable_resource_timing", false);
user_pref("dom.event.contextmenu.enabled", false);
user_pref("dom.ipc.plugins.reportCrashURL", false);
user_pref("dom.push.connection.enabled", false);
user_pref("dom.push.enabled", false);
user_pref("dom.security.https_only_mode_ever_enabled", true);
user_pref("dom.security.https_only_mode_send_http_background_request", false);
user_pref("dom.security.https_only_mode", true);
user_pref("dom.webnotifications.enabled", false);
user_pref("dom.webnotifications.serviceworker.enabled", false);
user_pref("extensions.blocklist.enabled", true);
user_pref("extensions.formautofill.addresses.enabled", false);
user_pref("extensions.formautofill.available", "off");
user_pref("extensions.formautofill.creditCards.available", false);
user_pref("extensions.formautofill.creditCards.enabled", false);
user_pref("extensions.formautofill.heuristics.enabled", false);
user_pref("extensions.getAddons.showPane", false);
user_pref("extensions.htmlaboutaddons.recommendations.enabled", false);
user_pref("extensions.pictureinpicture.enable_picture_in_picture_overrides", true);
user_pref("extensions.pocket.enabled", false);
user_pref("extensions.ui.locale.hidden", true);
user_pref("extensions.webcompat-reporter.enabled", false);
user_pref("extensions.webcompat.enable_shims", true);
user_pref("extensions.webcompat.perform_injections", true);
user_pref("extensions.webcompat.perform_ua_overrides", true);
user_pref("findbar.highlightAll", true);
user_pref("findbar.modalHighlight", true);
user_pref("font.default.x-western", "sans-serif");
user_pref("general.smoothScroll.msdPhysics.enabled", true);
user_pref("geo.enabled", false);
user_pref("geo.provider.network.url", "");
user_pref("intl.accept_languages", "en-US, en");
user_pref("javascript.use_us_english_locale", true);
user_pref("layout.spellcheckDefault", 2);
user_pref("lightweightThemes.getMoreURL", "");
user_pref("media.videocontrols.picture-in-picture.video-toggle.has-used", true);
user_pref("network.auth.subresource-http-auth-allow", 1);
user_pref("network.captive-portal-service.enabled", false);
user_pref("network.connectivity-service.enabled", false);
user_pref("network.connectivity-service.nat64-check", false);
user_pref("network.cookie.cookieBehavior", 1);
user_pref("network.dns.disablePrefetch", true);
user_pref("network.dns.disablePrefetchFromHTTPS", true);
user_pref("network.gio.supported-protocols", "");
user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true);
user_pref("network.http.referer.spoofSource", false);
user_pref("network.http.referer.trimmingPolicy", 0);
user_pref("network.http.referer.XOriginPolicy", 1);
user_pref("network.http.referer.XOriginTrimmingPolicy", 0);
user_pref("network.http.sendRefererHeader", 2);
user_pref("network.http.speculative-parallel-limit", 0);
user_pref("network.IDN_show_punycode", true);
user_pref("network.predictor.enable-prefetch", false);
user_pref("network.predictor.enabled", false);
user_pref("network.prefetch-next", false);
user_pref("network.trr.custom_uri", "https://cloudflare-dns.com/dns-query");
user_pref("network.trr.mode", 2);
user_pref("network.trr.uri", "https://cloudflare-dns.com/dns-query");
user_pref("pdfjs.enableScripting", false);
user_pref("privacy.annotate_channels.strict_list.enabled", true);
user_pref("privacy.donottrackheader.enabled", true);
user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false);
user_pref("privacy.partition.always_partition_third_party_non_cookie_storage", true);
user_pref("privacy.partition.network_state.ocsp_cache", true);
user_pref("privacy.partition.serviceWorkers", true);
user_pref("privacy.trackingprotection.cryptomining.enabled", true);
user_pref("privacy.trackingprotection.enabled", true);
user_pref("privacy.trackingprotection.socialtracking.enabled", true);
user_pref("security.cert_pinning.enforcement_level", 2);
user_pref("security.OCSP.enabled", 0);
user_pref("security.OCSP.require", true);
user_pref("security.ssl.require_safe_negotiation", true);
user_pref("security.ssl.treat_unsafe_negotiation_as_broken", true);
user_pref("security.tls.enable_0rtt_data", false);
user_pref("security.tls.version.enable-deprecated", false);
user_pref("signon.autofillForms.http", false);
user_pref("signon.autofillForms", false);
user_pref("signon.formlessCapture.enabled", false);
user_pref("signon.rememberSignons", false);
user_pref("toolkit.coverage.endpoint.base", "");
user_pref("toolkit.coverage.opt-out", true);
user_pref("toolkit.telemetry.archive.enabled", false);
user_pref("toolkit.telemetry.bhrPing.enabled", false);
user_pref("toolkit.telemetry.coverage.opt-out", true);
user_pref("toolkit.telemetry.enabled", false);
user_pref("toolkit.telemetry.firstShutdownPing.enabled", false);
user_pref("toolkit.telemetry.newProfilePing.enabled", false);
user_pref("toolkit.telemetry.server", "data:,");
user_pref("toolkit.telemetry.shutdownPingSender.enabled", false);
user_pref("toolkit.telemetry.unified", false);
user_pref("toolkit.telemetry.updatePing.enabled", false);
user_pref("webchannel.allowObject.urlWhitelist", "");
user_pref("xpinstall.signatures.required", true);
user_pref("xpinstall.whitelist.required", false);
-78
View File
@@ -1,78 +0,0 @@
#!/usr/bin/env bash
set -e
echo "🙏 Deep breaths, everything will (probably) be fine!"
echo ""
# location of the *full repo* (defaults to ~/.dotfiles)
DOTFILES="${DOTFILES:-"$HOME/.dotfiles"}"
# location of this script (should be right next to all the other files, but we handle that next if it's not)
INSTALLER_PATH="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
# if this is a codespace, link automatically cloned dotfiles repo to the expected DOTFILES
# https://docs.github.com/en/codespaces/troubleshooting/troubleshooting-personalization-for-codespaces#troubleshooting-dotfiles
if [[ "$CODESPACES" = "true" ]] && [[ -d /workspaces/.codespaces/.persistedshare/dotfiles ]]; then
ln -sf /workspaces/.codespaces/.persistedshare/dotfiles "$DOTFILES"
fi
# clone this repo if this script is all by itself and/or we're not in the expected location
if [[ "$INSTALLER_PATH" != "$DOTFILES" ]] && [[ ! -d "$DOTFILES" ]]; then
git clone https://github.com/jakejarvis/dotfiles.git "$DOTFILES"
echo "Successfully cloned the full repo to '$DOTFILES'"
echo "Run install.sh from that directory to continue. Exiting now..."
exit 0
fi
# set up symlinks from various default paths to files in this repo
if [[ ! -d ~/.config ]]; then
mkdir -p ~/.config
fi
if [[ ! -d ~/.ssh ]]; then
mkdir -p ~/.ssh && chmod 700 ~/.ssh
fi
ln -sf "$DOTFILES/zsh/.zshrc" ~/.zshrc
ln -sf "$DOTFILES/zsh/.zprofile" ~/.zprofile
ln -sf "$DOTFILES/bash/.bash_profile" ~/.bash_profile
ln -sf "$DOTFILES/ssh/.ssh/config" ~/.ssh/config
ln -sf "$DOTFILES/git/.gitconfig" ~/.gitconfig
ln -sf "$DOTFILES/git/.gitignore_global" ~/.gitignore
ln -sf "$DOTFILES/starship/config.toml" ~/.config/starship.toml
# this file will be sourced by .zshrc for more sensitive variables/settings
touch ~/.zshrc.local
# prepare zinit manually
ZINIT_HOME="${ZINIT_HOME:-"${XDG_DATA_HOME:-"${HOME}/.local/share"}/zinit/zinit.git"}"
if [[ ! -d "$ZINIT_HOME" ]]; then
mkdir -p "$(dirname "$ZINIT_HOME")"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# the remainder of the setup tasks are OS-specific
if [[ "$OSTYPE" = darwin* ]]; then
# final symlinks
ln -sf "$DOTFILES/nano/brew.nanorc" ~/.nanorc
ln -sf "$DOTFILES/Brewfile" ~/Brewfile
# suppress terminal login banners
touch ~/.hushlogin
# disable bash session restoration
touch ~/.bash_sessions_disable
source "$DOTFILES/macos/macos.sh"
elif [[ "$OSTYPE" = linux-gnu* ]] && [[ -z "$CODESPACES" ]]; then
# final symlinks
ln -sf "$DOTFILES/nano/default.nanorc" ~/.nanorc
source "$DOTFILES/linux/linux.sh"
else
echo "I don't recognize this OS... skipping extra steps."
fi
# wow
echo ""
echo "🤯 It actually worked!"
echo "Log out and log back in (or just restart) to finish installing all ZSH features."
-241
View File
@@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>build</key>
<string>1204</string>
<key>preferences</key>
<dict>
<key>Battery_MenubarMode</key>
<array>
<dict>
<key>key</key>
<string>1</string>
<key>uuid</key>
<string>7E56833D-E8AD-4038-9B0A-E7E1764D4D8F</string>
</dict>
<dict>
<key>key</key>
<string>2</string>
<key>uuid</key>
<string>16ED041D-EFD7-4609-9D04-2BA918554AB3</string>
</dict>
</array>
<key>Battery_TimeSize</key>
<integer>11</integer>
<key>CPU_CombineLogicalCores</key>
<integer>1</integer>
<key>CPU_DropdownOrderDisabled</key>
<string></string>
<key>CPU_MenubarGraphBreakdowns</key>
<integer>1</integer>
<key>CPU_ProcessCount</key>
<integer>15</integer>
<key>Disks_DropdownActivityDisplayMode</key>
<integer>2</integer>
<key>Disks_DropdownOrderDisabled</key>
<string>unmounted</string>
<key>Disks_DropdownShowAllActivity</key>
<integer>0</integer>
<key>Disks_HidePurgable</key>
<integer>0</integer>
<key>Disks_MenubarItems</key>
<array>
<dict>
<key>key</key>
<string>77222F6D-94A5-4B3B-91BF-0A850CDF12E4</string>
<key>name</key>
<string>Macintosh HD</string>
</dict>
</array>
<key>Disks_MenubarMode</key>
<array>
<dict>
<key>key</key>
<string>100</string>
<key>uuid</key>
<string>8E300A5F-38A2-4F82-A466-EEF6004D70B9</string>
</dict>
<dict>
<key>key</key>
<string>0</string>
<key>uuid</key>
<string>C2AFF963-B9AE-4BF8-8884-ED913411E137</string>
</dict>
</array>
<key>Disks_ProcessCount</key>
<integer>15</integer>
<key>Memory_AppFormat</key>
<integer>0</integer>
<key>Memory_DropdownOrder</key>
<string>memory,processes,pressure,swap,pages,buttons</string>
<key>Memory_DropdownOrderDisabled</key>
<string>pressure</string>
<key>Memory_MenubarGraphBreakdowns</key>
<integer>1</integer>
<key>Memory_MenubarMode</key>
<array>
<dict>
<key>key</key>
<string>100</string>
<key>uuid</key>
<string>90B3ECC4-6F52-470B-B321-B57FF9101802</string>
</dict>
<dict>
<key>key</key>
<string>6</string>
<key>uuid</key>
<string>E44DAA8A-4F57-498E-91BD-284828010F04</string>
</dict>
</array>
<key>Memory_ProcessCount</key>
<integer>15</integer>
<key>Migrated_6.0</key>
<true/>
<key>Migrated_6.22</key>
<true/>
<key>Migrated_6.5</key>
<true/>
<key>Migrated_6.52</key>
<true/>
<key>Migrated_6.60_ARM</key>
<true/>
<key>Network_AppSort</key>
<integer>0</integer>
<key>Network_DecimalLevelKB</key>
<integer>0</integer>
<key>Network_DecimalLevelMB</key>
<integer>2</integer>
<key>Network_DropdownCombineBandwidth</key>
<integer>1</integer>
<key>Network_DropdownOrderDisabled</key>
<string>inactive</string>
<key>Network_GraphMode</key>
<integer>1</integer>
<key>Network_GraphShowBackground</key>
<integer>0</integer>
<key>Network_GraphWidth</key>
<real>30</real>
<key>Network_IPV6Group</key>
<integer>1</integer>
<key>Network_IPV6ShowDeprecated</key>
<integer>0</integer>
<key>Network_MenubarMode</key>
<array>
<dict>
<key>key</key>
<string>100</string>
<key>uuid</key>
<string>3D976805-CA57-40FF-B5FA-0986865859CE</string>
</dict>
<dict>
<key>key</key>
<string>1</string>
<key>uuid</key>
<string>3E479985-8C40-47F6-8238-D7762E82C8B0</string>
</dict>
</array>
<key>Network_ProcessCount</key>
<integer>15</integer>
<key>Network_ShowBSD</key>
<integer>1</integer>
<key>Notifications-Enabled</key>
<false/>
<key>Notifications-Items</key>
<array>
<dict>
<key>enabled</key>
<true/>
<key>notification-type</key>
<string>1</string>
<key>rule-type</key>
<string>18</string>
<key>uuid</key>
<string>3BDA4498-0C70-48B2-B5D9-FE28E6D02A4C</string>
<key>value</key>
<string>978332400</string>
</dict>
<dict>
<key>enabled</key>
<true/>
<key>notification-type</key>
<string>1</string>
<key>rule-type</key>
<string>17</string>
<key>uuid</key>
<string>2F6A266A-47E4-4BE5-9B2C-D3A347152B55</string>
<key>value</key>
<string>1.00</string>
</dict>
<dict>
<key>enabled</key>
<true/>
<key>notification-type</key>
<string>0</string>
<key>rule-type</key>
<string>14</string>
<key>uuid</key>
<string>4D726ED7-6BEC-4530-A444-F3EE5A60954D</string>
<key>value</key>
<string>10.00</string>
</dict>
<dict>
<key>enabled</key>
<true/>
<key>notification-type</key>
<string>1</string>
<key>rule-type</key>
<string>20</string>
<key>uuid</key>
<string>B80FB10F-D841-4925-BD1B-E89AA45DBA4F</string>
<key>value</key>
<string>10.00</string>
</dict>
</array>
<key>Sensors-Limits-Updated</key>
<true/>
<key>Sensors_DropdownOrderDisabled</key>
<string></string>
<key>Sensors_MenubarFontStyle</key>
<integer>0</integer>
<key>Sensors_TemperatureMode</key>
<integer>0</integer>
<key>StatusItems-Order</key>
<array>
<integer>4</integer>
<integer>3</integer>
<integer>2</integer>
<integer>1</integer>
</array>
<key>Time_MenubarFormat</key>
<array>
<dict>
<key>format</key>
<array>
<array>
<string>EE</string>
<string>' '</string>
<string>hh</string>
<string>:</string>
<string>mm</string>
</array>
</array>
</dict>
</array>
<key>TimerFrequency</key>
<integer>2</integer>
<key>Zarya-TLE</key>
<dict>
<key>time</key>
<real>1668012542.6079049</real>
<key>tle</key>
<string>ISS (ZARYA)
1 25544U 98067A 22313.59953684 .00013763 00000+0 24956-3 0 9998
2 25544 51.6444 336.2388 0006809 53.3161 93.8274 15.49887825367737
</string>
</dict>
</dict>
<key>version</key>
<string>6.63</string>
</dict>
</plist>
File diff suppressed because it is too large Load Diff
-474
View File
@@ -1,474 +0,0 @@
{
"Custom Directory" : "No",
"Working Directory" : "\/Users\/jake",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 1,
"Green Component" : 0
},
"Rows" : 38,
"Ansi 11 Color" : {
"Red Component" : 0.95294123888015747,
"Color Space" : "sRGB",
"Blue Component" : 0.61568623781204224,
"Alpha Component" : 1,
"Green Component" : 0.97647064924240112
},
"Use Italic Font" : true,
"Foreground Color" : {
"Red Component" : 0.93725490570068359,
"Color Space" : "sRGB",
"Blue Component" : 0.92156857252120972,
"Alpha Component" : 1,
"Green Component" : 0.94117647409439087
},
"Right Option Key Sends" : 0,
"Show Status Bar" : false,
"Character Encoding" : 4,
"Selection Color" : {
"Red Component" : 0.57319694757461548,
"Color Space" : "sRGB",
"Blue Component" : 0.81719964742660522,
"Alpha Component" : 1,
"Green Component" : 0.73586553335189819
},
"Blend" : 0.50457144474637694,
"Show Mark Indicators" : false,
"Mouse Reporting" : true,
"Ansi 4 Color" : {
"Red Component" : 0.34117650985717773,
"Color Space" : "sRGB",
"Blue Component" : 0.99999994039535522,
"Alpha Component" : 1,
"Green Component" : 0.78039222955703735
},
"Non-ASCII Anti Aliased" : true,
"Sync Title" : false,
"Disable Window Resizing" : true,
"Description" : "Default",
"Close Sessions On End" : true,
"Jobs to Ignore" : [
"rlogin",
"ssh",
"slogin",
"telnet"
],
"Scrollback With Status Bar" : true,
"Scrollback Lines" : 0,
"Scrollback in Alternate Screen" : true,
"Draw Powerline Glyphs" : false,
"Status Bar Layout" : {
"components" : [
{
"class" : "iTermStatusBarSpringComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"iTermStatusBarSpringComponentSpringConstantKey" : 0.01,
"base: compression resistance" : 1,
"iTermStatusBarSpringComponentSizeMultipleKey" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 1,
"remove empty components" : false,
"auto-rainbow style" : 0
}
}
}
],
"advanced configuration" : {
"remove empty components" : true,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 1,
"auto-rainbow style" : 0
}
},
"Hide After Opening" : false,
"Brighten Bold Text" : true,
"Flashing Bell" : false,
"Cursor Guide Color" : {
"Red Component" : 0.70213186740875244,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 0.25,
"Green Component" : 0.9268307089805603
},
"BM Growl" : false,
"AWDS Window Directory" : "",
"Open Password Manager Automatically" : false,
"Icon" : 1,
"Link Color" : {
"Red Component" : 0.29264676570892334,
"Color Space" : "sRGB",
"Blue Component" : 0.85775750875473022,
"Alpha Component" : 1,
"Green Component" : 0.66938728094100952
},
"Shortcut" : "",
"Use Non-ASCII Font" : false,
"Ansi 3 Color" : {
"Red Component" : 0.95294123888015747,
"Color Space" : "sRGB",
"Blue Component" : 0.61568623781204224,
"Alpha Component" : 1,
"Green Component" : 0.97647064924240112
},
"Background Image Location" : "",
"Bold Color" : {
"Red Component" : 0.97102361917495728,
"Color Space" : "sRGB",
"Blue Component" : 0.97102349996566772,
"Alpha Component" : 1,
"Green Component" : 0.97102349996566772
},
"Unlimited Scrollback" : true,
"Custom Command" : "No",
"AWDS Tab Option" : "No",
"Smart Selection Rules" : [
{
"notes" : "Word bounded by whitespace",
"regex" : "\\S+",
"precision" : "low"
},
{
"notes" : "C++ namespace::identifier",
"regex" : "([a-zA-Z0-9_]+::)+[a-zA-Z0-9_]+",
"precision" : "normal"
},
{
"notes" : "Paths",
"precision" : "normal",
"regex" : "\\~?\/?([[:letter:][:number:]._-]+\/+)+[[:letter:][:number:]._-]+\/?",
"actions" : [
]
},
{
"notes" : "Quoted string",
"regex" : "@?\"(?:[^\"\\\\]|\\\\.)*\"",
"precision" : "normal"
},
{
"notes" : "Java\/Python include paths",
"regex" : "([[:letter:][:number:]._]+\\.)+[[:letter:][:number:]._]+",
"precision" : "normal"
},
{
"notes" : "mailto URL",
"regex" : "\\bmailto:([a-z0-9A-Z_]+@)?([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+\\b",
"precision" : "normal"
},
{
"notes" : "Obj-C selector",
"regex" : "@selector\\([^)]+\\)",
"precision" : "high"
},
{
"notes" : "email address",
"regex" : "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}\\b",
"precision" : "high"
},
{
"notes" : "HTTP URL",
"regex" : "https?:\/\/([a-z0-9A-Z]+(:[a-zA-Z0-9]+)?@)?([a-z0-9A-Z][-a-z0-9A-Z]*\\.)+[A-Za-z][-A-Za-z]*((:[0-9]+)?)(\/[a-zA-Z0-9;\/\\.\\-_+%?&@=#\\(\\)~]*)?",
"precision" : "very_high"
},
{
"notes" : "SSH URL",
"precision" : "very_high",
"regex" : "\\bssh:([a-z0-9A-Z_]+@)?([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+\\b",
"actions" : [
]
},
{
"notes" : "Telnet URL",
"regex" : "\\btelnet:([a-z0-9A-Z_]+@)?([a-zA-Z0-9\\-]+\\.)*[a-zA-Z0-9\\-]+\\b",
"precision" : "very_high"
}
],
"Title Components" : 2,
"Keyboard Map" : {
"0x5e-0x60000" : {
"Text" : "0x1e",
"Action" : 11
},
"0xf702-0x280000" : {
"Action" : 10,
"Text" : "b"
},
"0xf702-0x260000" : {
"Text" : "0x1b 0x1b 0x5b 0x44",
"Action" : 11
},
"0xf703-0x280000" : {
"Action" : 10,
"Text" : "f"
},
"0xf70a-0x20000" : {
"Text" : "[28~",
"Action" : 10
},
"0xf703-0x260000" : {
"Text" : "[C",
"Action" : 10
},
"0x2d-0x40000" : {
"Text" : "0x1f",
"Action" : 11
},
"0xf702-0x220000" : {
"Text" : "[D",
"Action" : 10
},
"0xf703-0x240000" : {
"Text" : "[5C",
"Action" : 10
},
"0xf703-0x220000" : {
"Text" : "[C",
"Action" : 10
},
"0xf700-0x280000" : {
"Text" : "[A",
"Action" : 10
},
"0xf72b-0x20000" : {
"Text" : "[F",
"Action" : 10
},
"0xf700-0x260000" : {
"Text" : "[A",
"Action" : 10
},
"0xf701-0x280000" : {
"Text" : "[B",
"Action" : 10
},
"0xf700-0x240000" : {
"Text" : "[A",
"Action" : 10
},
"0xf701-0x260000" : {
"Text" : "[B",
"Action" : 10
},
"0xf700-0x220000" : {
"Text" : "[A",
"Action" : 10
},
"0xf701-0x240000" : {
"Text" : "[B",
"Action" : 10
},
"0xf72b-0x40000" : {
"Text" : "",
"Action" : 4
},
"0xf708-0x20000" : {
"Text" : "[25~",
"Action" : 10
},
"0xf701-0x220000" : {
"Text" : "[B",
"Action" : 10
},
"0xf709-0x20000" : {
"Text" : "[26~",
"Action" : 10
},
"0xf70b-0x20000" : {
"Text" : "[29~",
"Action" : 10
},
"0xf702-0x240000" : {
"Text" : "[5D",
"Action" : 10
},
"0xf729-0x20000" : {
"Text" : "[H",
"Action" : 10
},
"0xf729-0x40000" : {
"Text" : "",
"Action" : 5
}
},
"Ansi 14 Color" : {
"Red Component" : 0.60392171144485474,
"Color Space" : "sRGB",
"Blue Component" : 0.99607843160629272,
"Alpha Component" : 1,
"Green Component" : 0.92941170930862427
},
"Ansi 2 Color" : {
"Red Component" : 0.35294127464294434,
"Color Space" : "sRGB",
"Blue Component" : 0.55686265230178833,
"Alpha Component" : 1,
"Green Component" : 0.96862751245498657
},
"Send Code When Idle" : false,
"ASCII Anti Aliased" : true,
"Tags" : [
],
"Ansi 9 Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0.34117639064788818,
"Alpha Component" : 1,
"Green Component" : 0.36078426241874695
},
"Use Bold Font" : true,
"Silence Bell" : true,
"Ansi 12 Color" : {
"Red Component" : 0.34117650985717773,
"Color Space" : "sRGB",
"Blue Component" : 0.99999994039535522,
"Alpha Component" : 1,
"Green Component" : 0.78039222955703735
},
"Window Type" : 0,
"Allow Title Reporting" : false,
"Has Hotkey" : false,
"Use Bright Bold" : true,
"Cursor Text Color" : {
"Red Component" : 0.15686270594596863,
"Color Space" : "sRGB",
"Blue Component" : 0.21176469326019287,
"Alpha Component" : 1,
"Green Component" : 0.16470584273338318
},
"Default Bookmark" : "No",
"Cursor Color" : {
"Red Component" : 0.91646724939346313,
"Color Space" : "sRGB",
"Blue Component" : 0.91647690534591675,
"Alpha Component" : 1,
"Green Component" : 0.91648870706558228
},
"Ansi 1 Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0.34117639064788818,
"Alpha Component" : 1,
"Green Component" : 0.36078426241874695
},
"Name" : "Default",
"Guid" : "EDCECF3F-4620-4117-8E79-0B8C58327F3E",
"Blinking Cursor" : true,
"Ansi 8 Color" : {
"Red Component" : 0.40784323215484619,
"Color Space" : "sRGB",
"Blue Component" : 0.40784311294555664,
"Alpha Component" : 1,
"Green Component" : 0.40784311294555664
},
"Ansi 10 Color" : {
"Red Component" : 0.35294127464294434,
"Color Space" : "sRGB",
"Blue Component" : 0.55686265230178833,
"Alpha Component" : 1,
"Green Component" : 0.96862751245498657
},
"Idle Code" : 0,
"Badge Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 0.5,
"Green Component" : 0.1491314172744751
},
"Semantic History" : {
"editor" : "com.microsoft.VSCode",
"text" : "",
"action" : "editor"
},
"Ambiguous Double Width" : false,
"Blur Radius" : 10.045428856382978,
"Cursor Type" : 1,
"Ansi 0 Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 1,
"Green Component" : 0
},
"AWDS Pane Directory" : "",
"Blur" : true,
"Normal Font" : "SFMonoNerdFontComplete-Regular 12",
"Vertical Spacing" : 1.3,
"Session Close Undo Timeout" : 15,
"Ansi 7 Color" : {
"Red Component" : 0.94509810209274292,
"Color Space" : "sRGB",
"Blue Component" : 0.94117647409439087,
"Alpha Component" : 1,
"Green Component" : 0.94509810209274292
},
"Space" : 0,
"AWDS Tab Directory" : "",
"AWDS Pane Option" : "No",
"Command" : "",
"Terminal Type" : "xterm-256color",
"Horizontal Spacing" : 1,
"Option Key Sends" : 2,
"Only The Default BG Color Uses Transparency" : true,
"Blink Allowed" : false,
"Minimum Contrast" : 0,
"Ansi 15 Color" : {
"Red Component" : 0.94509810209274292,
"Color Space" : "sRGB",
"Blue Component" : 0.94117647409439087,
"Alpha Component" : 1,
"Green Component" : 0.94509810209274292
},
"Open Toolbelt" : false,
"Unicode Version" : 9,
"Ansi 6 Color" : {
"Red Component" : 0.60392171144485474,
"Color Space" : "sRGB",
"Blue Component" : 0.99607843160629272,
"Alpha Component" : 1,
"Green Component" : 0.92941170930862427
},
"Transparency" : 0.037799202127659574,
"Initial Text" : "",
"Background Color" : {
"Red Component" : 0.078431372549019607,
"Color Space" : "sRGB",
"Blue Component" : 0.078431372549019607,
"Alpha Component" : 1,
"Green Component" : 0.078431372549019607
},
"Screen" : -1,
"Initial Use Transparency" : true,
"AWDS Window Option" : "No",
"Bound Hosts" : [
],
"Non Ascii Font" : "SFMonoNerdFontComplete-Regular 12",
"Ansi 13 Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0.75686269998550415,
"Alpha Component" : 1,
"Green Component" : 0.4156862199306488
},
"Columns" : 120,
"Use Tab Color" : false,
"Visual Bell" : true,
"ASCII Ligatures" : true,
"Ansi 5 Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0.75686269998550415,
"Alpha Component" : 1,
"Green Component" : 0.4156862199306488
},
"Thin Strokes" : 4
}
-344
View File
@@ -1,344 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.34117639064788818</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.36078426241874695</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.55686265230178833</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.96862751245498657</real>
<key>Red Component</key>
<real>0.35294127464294434</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.61568623781204224</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.97647064924240112</real>
<key>Red Component</key>
<real>0.95294123888015747</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.99999994039535522</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.78039222955703735</real>
<key>Red Component</key>
<real>0.34117650985717773</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.75686269998550415</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.4156862199306488</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.99607843160629272</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.92941170930862427</real>
<key>Red Component</key>
<real>0.60392171144485474</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.94117647409439087</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.94509810209274292</real>
<key>Red Component</key>
<real>0.94509810209274292</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.55686265230178833</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.96862751245498657</real>
<key>Red Component</key>
<real>0.35294127464294434</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.61568623781204224</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.97647064924240112</real>
<key>Red Component</key>
<real>0.95294123888015747</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.99999994039535522</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.78039222955703735</real>
<key>Red Component</key>
<real>0.34117650985717773</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.75686269998550415</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.4156862199306488</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.99607843160629272</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.92941170930862427</real>
<key>Red Component</key>
<real>0.60392171144485474</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.94117647409439087</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.94509810209274292</real>
<key>Red Component</key>
<real>0.94509810209274292</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.40784311294555664</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.40784311294555664</real>
<key>Red Component</key>
<real>0.40784323215484619</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.34117639064788818</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.36078426241874695</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Background Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.078431375324726105</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.078431375324726105</real>
<key>Red Component</key>
<real>0.078431375324726105</real>
</dict>
<key>Badge Color</key>
<dict>
<key>Alpha Component</key>
<real>0.5</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.1491314172744751</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Bold Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.97102349996566772</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.97102349996566772</real>
<key>Red Component</key>
<real>0.97102361917495728</real>
</dict>
<key>Cursor Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.91647690534591675</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.91648870706558228</real>
<key>Red Component</key>
<real>0.91646724939346313</real>
</dict>
<key>Cursor Guide Color</key>
<dict>
<key>Alpha Component</key>
<real>0.25</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.9268307089805603</real>
<key>Red Component</key>
<real>0.70213186740875244</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.21176469326019287</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.16470584273338318</real>
<key>Red Component</key>
<real>0.15686270594596863</real>
</dict>
<key>Foreground Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.92156857252120972</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.94117647409439087</real>
<key>Red Component</key>
<real>0.93725490570068359</real>
</dict>
<key>Link Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.85775750875473022</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.66938728094100952</real>
<key>Red Component</key>
<real>0.29264676570892334</real>
</dict>
<key>Selected Text Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.0</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.81719964742660522</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.73586553335189819</real>
<key>Red Component</key>
<real>0.57319694757461548</real>
</dict>
</dict>
</plist>
-61
View File
@@ -1,61 +0,0 @@
#!/usr/bin/env bash
set -e
if [[ -e /etc/debian_version ]]; then
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
zsh \
zsh-common \
zsh-doc \
man \
curl \
wget \
gnupg \
apt-transport-https \
ca-certificates \
lsb-release \
tzdata \
shared-mime-info \
build-essential \
file \
procps \
git
sudo apt-get clean -y
fi
# set machine's timezone to local time
sudo timedatectl set-timezone America/New_York || true
# install linuxbrew:
# https://docs.brew.sh/Homebrew-on-Linux#install
if ! command -v brew &>/dev/null; then
# TODO: currently tricking installer into thinking we're running it as a non-root user, it doesn't _really_ matter in
# my use cases (e.g. codespaces) but this is apparently very unsafe.
# https://github.com/Homebrew/install/blob/master/install.sh#L302
NONINTERACTIVE=1 UID=999 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# install tailscale
if ! command -v tailscale &>/dev/null; then
curl -fsSL https://tailscale.com/install.sh | bash
fi
# install fnm
if ! command -v fnm &>/dev/null; then
curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell
fi
# install rbenv & ruby-build
if ! command -v rbenv &>/dev/null; then
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
fi
# install pyenv
if ! command -v pyenv &>/dev/null; then
curl -fsSL https://github.com/pyenv/pyenv-installer/raw/HEAD/bin/pyenv-installer | bash
fi
# set login shell to zsh
sudo chsh -s "$(which zsh)" "$(whoami)"
-308
View File
@@ -1,308 +0,0 @@
#!/usr/bin/env bash
# Modified and patched together from a few sources:
#
# https://mths.be/macos
# https://github.com/paulirish/dotfiles/blob/master/.osx
# https://github.com/kevinSuttle/macOS-Defaults/blob/master/.macos
set -e
# Change new hostname here if necessary
COMPUTER_NAME="JJ-MBA"
# Quit System Preferences.app if open
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until this script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "$COMPUTER_NAME"
sudo scutil --set HostName "$COMPUTER_NAME"
sudo scutil --set LocalHostName "$COMPUTER_NAME"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPUTER_NAME"
# Set language and text formats
defaults write NSGlobalDomain AppleLanguages -array "en"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
defaults write NSGlobalDomain AppleMetricUnits -bool false
# Set the timezone (see `sudo systemsetup -listtimezones` for other values)
sudo systemsetup -settimezone "America/New_York" >/dev/null
# Disable audio feedback when volume is changed
defaults write com.apple.sound.beep.feedback -bool false
# Menu bar: show battery percentage
defaults write com.apple.menuextra.battery ShowPercent "YES"
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
# Disable Resume system-wide
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
# Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
###############################################################################
# Keyboard & Input #
###############################################################################
# Disable smart quotes and dashes as they're annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a faster keyboard repeat rate (but not too fast, thanks butterfly keyboard)
defaults write NSGlobalDomain KeyRepeat -int 5
defaults write NSGlobalDomain InitialKeyRepeat -int 25
# Automatically illuminate built-in MacBook keyboard in low light
defaults write com.apple.BezelServices kDim -bool true
# Turn off keyboard illumination when computer is not used for 5 minutes
defaults write com.apple.BezelServices kDimTime -int 300
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
###############################################################################
# Trackpad, mouse, Bluetooth accessories #
###############################################################################
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
###############################################################################
# Energy saving #
###############################################################################
# Restart automatically on power loss
sudo pmset -a autorestart 1
# Restart automatically if the computer freezes
sudo systemsetup -setrestartfreeze on
# Set standby delay to 24 hours (default is 1 hour)
sudo pmset -a standbydelay 86400
# Don't automatically boot when shut down completely and lid opened
sudo nvram AutoBoot=%00
###############################################################################
# Screen #
###############################################################################
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
###############################################################################
# Finder #
###############################################################################
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Use AirDrop over every interface
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Always open everything in Finder's list view.
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Show the ~/Library folder
chflags nohidden ~/Library
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
###############################################################################
# Dock #
###############################################################################
# Automatically hide and show the Dock without delay
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
# Group windows by application in Mission Control
defaults write com.apple.dock expose-group-by-app -bool true
# Disable hot corners
defaults write com.apple.dock wvous-tl-corner -int 0
defaults write com.apple.dock wvous-tr-corner -int 0
defaults write com.apple.dock wvous-bl-corner -int 0
# Lock screen via bottom-right hot corner
defaults write com.apple.dock wvous-br-corner -int 13
defaults write com.apple.dock wvous-br-modifier -int 0
# Don't show recently used applications in the Dock
defaults write com.Apple.Dock show-recents -bool false
# Disable the Launchpad gesture (pinch with thumb and three fingers)
defaults write com.apple.dock showLaunchpadGestureEnabled -int 0
###############################################################################
# Mail #
###############################################################################
# Disable inline attachments (just show the icons)
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
# Compose mail in plain-text
defaults write com.apple.mail SendFormat Plain
# Disable remote content
defaults write com.apple.mail DisableURLLoading -bool true
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
# Sort Activity Monitor results by CPU usage
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
###############################################################################
# Photos #
###############################################################################
# Prevent Photos from opening automatically when devices are plugged in
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
###############################################################################
# Messages #
###############################################################################
# Disable automatic emoji substitution (i.e. use plain text smileys)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes as it's annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# Disable continuous spell checking
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
###############################################################################
# TextEdit #
###############################################################################
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
###############################################################################
# iTerm 2 #
###############################################################################
# Dont display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
###############################################################################
# GPGMail 2 #
###############################################################################
# Disable signing emails by default
defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
###############################################################################
# Software Updates #
###############################################################################
# Enable the automatic update check
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -bool true
# Download newly available updates in background
defaults write com.apple.SoftwareUpdate AutomaticDownload -bool true
# Install System data files & security updates
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
# Turn off app auto-update
defaults write com.apple.commerce AutoUpdate -bool false
###############################################################################
# Finished! #
###############################################################################
echo "All done! Some of these changes require a logout/restart to take effect."
-48
View File
@@ -1,48 +0,0 @@
#!/usr/bin/env bash
set -e
# Ask for the administrator password upfront
sudo -v
# Make sure macOS is fully up to date before doing anything
sudo softwareupdate --install --all
# Install Rosetta 2
sudo softwareupdate --install-rosetta --agree-to-license
# Install Xcode Command Line Tools
sudo xcode-select --install
# Accept Xcode license
sudo xcodebuild -license accept
# This whole thing kinda hinges on having Homebrew...
# Check for it and install from GitHub if it's not there
if ! command -v brew &>/dev/null; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Disable analytics
# https://docs.brew.sh/Analytics
brew analytics off
# Update Homebrew recipes
brew update
# Install more current ZSH and set as default shell
# https://stackoverflow.com/a/44549662/1438024
brew install zsh
sudo sh -c "echo $(brew --prefix)/bin/zsh >> /etc/shells"
chsh -s "$(brew --prefix)/bin/zsh"
# https://github.com/ohmyzsh/ohmyzsh/issues/6835#issuecomment-390187157
chmod 755 "$(brew --prefix)/share/zsh"
chmod 755 "$(brew --prefix)/share/zsh/site-functions"
# Install all apps from the Brewfile, ignore errors
brew tap homebrew/bundle
brew bundle --no-lock || true
# Set macOS defaults
# Needs to be last since this will restart everything when done
source ./macos/defaults.sh
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 KiB

-32
View File
@@ -1,32 +0,0 @@
# Enable built-in syntax highlighting
# IMPORTANT: this path is specific to homebrew's nano, hence this duplicate rc file only for macOS, which AFAIK is the
# best way to do this...
include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc"
# Non-default settings
set historylog # Save the last 100 history searches for later use.
# set positionlog # Saves the cursor position between editing sessions.
set zap # Allows you to highlight text (CTRL+SHIFT+ARROW) and delete it with backspace.
set afterends # Ctrl+Right moves to end of word instead of beginning.
set wordchars "_" # Recognize _ as part of a word.
set autoindent # A new line will have the same number of tabs/leading spaces as the previous one.
# set tabsize 2
# set tabstospaces
# Fix option+left/right word skipping
# https://unix.stackexchange.com/a/392309
unbind M-B all
unbind M-F all
bind M-B prevword main
bind M-F nextword main
# Muscle memory adaptations
bind ^s writeout main # Ctrl+S for save.
bind ^f whereis main # Ctrl+F for search.
# bind ^h replace main # Ctrl+H for find/replace.
bind ^z undo main # Ctrl+Z for undo.
# bind ^y redo main # Ctrl+Y for redo.
# bind ^x cut main # Ctrl+X for cut.
# bind ^c copy main # Ctrl+C for copy.
# bind ^v paste all # Ctrl+V for paste.
bind ^/ comment main # Ctrl+/ for (un)commenting current line.
-58
View File
@@ -1,58 +0,0 @@
#!/usr/bin/env bash
set -e
if ! command -v fnm &>/dev/null; then
echo "fnm not found, exiting..."
return
fi
fnm install --latest --corepack-enabled
npm install --global npm
# npm ls --global --parseable --depth=0 | awk '{gsub(/\/.*\//,"",$1); print}' | sort -u
packages=(
@angular/cli
@babel/cli
@babel/core
@lhci/cli
@vercel/ncc
autoprefixer
cross-env
depcheck
dts-gen
dtslint
esbuild
eslint
gatsby-cli
gzip-size-cli
json-server
markdownlint-cli2
netlify-cli
nodemon
np
npm-check-updates
npm-name-cli
pm2
postcss
postcss-cli
prettier
release-it
rollup
serverless
stylelint
superstatic
svgo
terser
typescript
typesync
vercel
webpack
webpack-cli
)
for p in "${packages[@]}"; do
NPM_CONFIG_FUND=false npm install --global --no-audit "$p" || echo "$p not found"
done
unset p packages
-6
View File
@@ -1,6 +0,0 @@
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+tab", "command": "workbench.action.nextEditor" },
{ "key": "ctrl+shift+tab", "command": "workbench.action.previousEditor" }
]
-140
View File
@@ -1,140 +0,0 @@
// Place your settings in this file to overwrite the default settings
{
"telemetry.telemetryLevel": "off",
"editor.lineHeight": 23,
"editor.tabSize": 2,
"editor.rulers": [
120
],
"editor.suggestSelection": "first",
"editor.acceptSuggestionOnEnter": "smart",
"extensions.autoUpdate": true,
"extensions.ignoreRecommendations": true,
"workbench.colorCustomizations": {},
"workbench.colorTheme": "GitHub Dark",
"workbench.tree.expandMode": "singleClick",
"workbench.enableExperiments": false,
"workbench.quickOpen.preserveInput": true,
"workbench.startupEditor": "none",
"workbench.editor.openPositioning": "last",
"workbench.settings.enableNaturalLanguageSearch": false,
"workbench.tips.enabled": false,
"workbench.view.alwaysShowHeaderActions": true,
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.tabSizing": "shrink",
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.cursorBlinking": true,
"remote.SSH.showLoginTerminal": true,
"window.openFilesInNewWindow": "default",
"explorer.confirmDragAndDrop": false,
"diffEditor.renderSideBySide": true,
"git.enableCommitSigning": true,
"git.showPushSuccessNotification": true,
"git.autofetch": true,
"git.allowForcePush": true,
"git.fetchOnPull": true,
"git.suggestSmartCommit": false,
"git.scanRepositories": [
"~/source"
],
"css.lint.important": "warning",
"css.lint.unknownVendorSpecificProperties": "warning",
"css.lint.zeroUnits": "warning",
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"scss.lint.zeroUnits": "warning",
"stylelint.reportNeedlessDisables": true,
"php.validate.run": "onType",
"markdown.preview.lineHeight": 1.75,
"githubPullRequests.defaultMergeMethod": "rebase",
"githubIssues.useBranchForIssues": "prompt",
"githubIssues.queries": [
{
"label": "My Issues",
"query": "default"
},
{
"label": "Created Issues",
"query": "author:${user} state:open repo:${owner}/${repository} sort:updated-desc"
}
],
"dotfiles.repository": "https://github.com/jakejarvis/dotfiles.git",
"material-icon-theme.activeIconPack": "none",
"material-icon-theme.folders.theme": "specific",
"editor.minimap.enabled": false,
"editor.inlineSuggest.enabled": true,
"diffEditor.ignoreTrimWhitespace": false,
"javascript.inlayHints.parameterNames.enabled": "all",
"javascript.inlayHints.parameterTypes.enabled": true,
"javascript.inlayHints.variableTypes.enabled": true,
"javascript.inlayHints.propertyDeclarationTypes.enabled": true,
"typescript.inlayHints.enumMemberValues.enabled": true,
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.parameterTypes.enabled": true,
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
"typescript.inlayHints.variableTypes.enabled": true,
"typescript.inlayHints.parameterNames.enabled": "all",
"javascript.inlayHints.functionLikeReturnTypes.enabled": true,
"javascript.inlayHints.enumMemberValues.enabled": true,
"terminal.integrated.fontFamily": "'SFMono Nerd Font', 'SF Mono', 'Meslo LG M for Powerline', Menlo, Monaco, 'Courier New', monospace",
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.lineHeight": 1.25,
"editor.renderWhitespace": "none",
"files.associations": {
"*.html": "html",
"*.htm": "html",
"*.mdx": "markdown"
},
"explorer.autoReveal": "focusNoScroll",
"git.autoStash": true,
"git.rebaseWhenSync": true,
"githubIssues.workingIssueFormatScm": "${issueTitle} (fixes #${issueNumber})",
"gulp.autoDetect": "on",
"html.format.templating": true,
"dotfiles.targetPath": "~/.dotfiles",
"stylelint.packageManager": "yarn",
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.format.semicolons": "insert",
"javascript.preferences.quoteStyle": "double",
"js/ts.implicitProjectConfig.experimentalDecorators": true,
"js/ts.implicitProjectConfig.strictNullChecks": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.semicolons": "insert",
"typescript.preferences.quoteStyle": "double",
"typescript.surveys.enabled": false,
"stylelint.validate": [
"css",
"less",
"sass",
"scss",
"styled-css"
],
"files.trimTrailingWhitespace": true,
"security.workspace.trust.banner": "always",
"scss.lint.duplicateProperties": "error",
"scss.lint.unknownVendorSpecificProperties": "warning",
"git.allowNoVerifyCommit": true,
"git.enableSmartCommit": true,
"remoteHub.richNavigation.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.accessibilitySupport": "off",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.implementationsCodeLens.enabled": true,
"typescript.preferences.importModuleSpecifierEnding": "minimal",
"editor.inlayHints.enabled": "off",
"editor.fontFamily": "'SF Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 12.5,
"typescript.tsserver.log": "off",
"workbench.iconTheme": "material-icon-theme",
"editor.unicodeHighlight.allowedCharacters": {
"": true
},
"githubPullRequests.pullBranch": "never"
}
-1
View File
@@ -1 +0,0 @@
# Intentionally left blank.
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env zsh
# set DOTFILES_DEBUG to trace startup times (1/2)
[[ "$DOTFILES_DEBUG" != "1" ]] || zmodload zsh/zprof
# path to this directory:
export ZSH_CUSTOM=~/.dotfiles/zsh
# load .zsh files from the above dir in this order:
for _dotzsh in "$ZSH_CUSTOM"/custom/{common,env,path,aliases,functions,plugins}.zsh; do
if [[ -f "$_dotzsh" ]]; then
source "$_dotzsh"
fi
done
unset _dotzsh
# macos.zsh has aliases, functions, etc specific to macOS:
if [[ "$OSTYPE" = darwin* ]] && [[ -f "$ZSH_CUSTOM"/custom/macos.zsh ]]; then
source "$ZSH_CUSTOM"/custom/macos.zsh
fi
if [[ -f ~/.zshrc.local ]]; then
source ~/.zshrc.local
fi
# uncomment to debug startup time (2/2)
[[ "$DOTFILES_DEBUG" != "1" ]] || zprof
-125
View File
@@ -1,125 +0,0 @@
#!/usr/bin/env zsh
# allow sudo-able aliases
alias sudo="sudo "
# colorful ls
alias ls="ls -G --color=auto"
alias ll="ls -lah"
alias la="ls -a"
alias l="ll"
# easier dotfile tinkering
alias shreload="exec \$SHELL"
alias shdebug="DOTFILES_DEBUG=1 exec \$SHELL"
# git
alias g="git"
alias gc="git commit -m" # + commit message
alias gca="git add . && git commit -m" # + commit message
alias gs="git status -sb"
alias gl="git log --pretty=short"
alias gd="git diff"
alias gds="git diff --staged"
alias gpom="git push origin main"
alias glom="git pull origin main"
alias gpo="git push origin" # + branch name
alias glo="git pull origin" # + branch name
alias glfm="git fetch && git reset origin/main --hard"
alias gb="git checkout" # + existing branch name
alias gbn="git checkout -b" # + new branch name
alias grm="git rebase -i origin/main"
alias gsub="git submodule update --recursive --remote"
alias gundo="git reset --soft HEAD~1"
alias gres="git reset"
alias github="gh repo view --web"
alias gist="gh gist create --web"
# docker
alias dps="docker ps -a"
dbar() {
# build a Dockerfile in the current directory and run it interactively:
# https://stackoverflow.com/questions/45141402/build-and-run-dockerfile-with-one-command/59220656#59220656
docker run --rm -it "$(docker build --no-cache -q .)"
}
dsh() {
docker exec -it "$1" /bin/sh
}
# alias dc="docker-compose"
alias dc="docker compose"
alias dcu="dc up -d"
alias dcd="dc down"
alias dcr="dcd && dcu"
alias dcl="dc logs -f"
# multipass
alias mp="multipass"
mpl() {
# creates VM and opens its bash shell
# `mpl test1 4G 20.04`
multipass launch "${2:-jammy}" --cpus=4 --memory="${3:-2G}" --disk="${4:-20G}" --name="$1" && \
multipass shell "$1"
}
mpd() {
multipass delete "$1" && multipass purge
}
alias mpls="multipass list"
alias mpsh="multipass shell"
alias mpk="multipass stop"
# Node/NPM/Yarn
alias npr="npm run"
alias yar="yarn run"
alias pnpr="pnpm run"
alias fresh_npm="rm -rf node_modules package-lock.json && npm install"
alias fresh_yarn="rm -rf node_modules yarn.lock && yarn install"
alias fresh_pnpm="rm -rf node_modules pnpm-lock.yaml && pnpm install"
# uncomment to use VS Code insiders build
# alias code="code-insiders"
# open current working directory in VS Code
alias vs="code ."
# an original creation, see https://github.com/jakejarvis/simpip
alias ipv4="curl -4 simpip.com --max-time 1 --proto-default https --silent"
alias ipv6="curl -6 simpip.com --max-time 1 --proto-default https --silent"
alias ip="ipv4; ipv6"
alias ip-local="ipconfig getifaddr en0"
alias ips="ip; ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# youtube-dl
alias youtube-dl="yt-dlp" # better youtube-dl fork: https://github.com/yt-dlp/yt-dlp
alias ytdl="youtube-dl -f bestvideo+bestaudio"
alias ytmp3="youtube-dl -f bestaudio -x --audio-format mp3 --audio-quality 320K"
# Hugo: build & install from source as `hugo-dev`
make_hugo() {
if [[ ! -d "$GOPATH"/src/github.com/gohugoio/hugo ]]; then
mkdir -p "$GOPATH"/src/github.com/gohugoio/hugo
git clone https://github.com/gohugoio/hugo.git "$GOPATH"/src/github.com/gohugoio/hugo
fi
if ! command -v mage &>/dev/null; then
go install github.com/magefile/mage@latest
fi
# parentheses lets us cd to Hugo path without changing our current location
(
cd "$GOPATH"/src/github.com/gohugoio/hugo \
&& "$GOPATH"/bin/hugo-dev env 2>/dev/null || true \
&& git checkout master \
&& mage uninstall \
&& git pull origin master \
&& git reset --hard HEAD \
&& mage -v hugo \
&& HUGO_BUILD_TAGS=extended mage -v install \
&& mv -fv "$GOPATH"/bin/hugo "$GOPATH"/bin/hugo-dev \
&& "$GOPATH"/bin/hugo-dev env
)
}
# run `hugo config` first to make sure we're in a Hugo directory:
alias hugo_clean="hugo config 1>/dev/null && rm -rf public/ resources/ build/"
# misc.
alias screenfetch="neofetch"
alias weather="curl 'https://wttr.in/?format=v2'"
-77
View File
@@ -1,77 +0,0 @@
#!/usr/bin/env zsh
autoload -U colors && \
colors
autoload -Uz select-word-style && \
select-word-style bash
# autoload -Uz bracketed-paste-magic && \
# zle -N bracketed-paste bracketed-paste-magic
# zstyle ':bracketed-paste-magic' active-widgets '.self-*'
autoload -Uz url-quote-magic && \
zle -N self-insert url-quote-magic
zstyle ":urlglobber" url-other-schema ftp git gopher http https magnet && \
export DISABLE_MAGIC_FUNCTIONS=true # make pasting into terminal faster
# enable bash-like 'help' command for zsh:
# https://stackoverflow.com/questions/4405382/how-can-i-read-documentation-about-built-in-zsh-commands
unalias run-help 2>/dev/null
autoload run-help
alias help=run-help
# ---
setopt notify
setopt complete_aliases
setopt complete_in_word
setopt always_to_end
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt share_history
setopt inc_append_history
setopt rc_quotes
setopt extended_glob
setopt glob_dots
unsetopt case_glob
unsetopt beep # kindly stfu
unsetopt list_beep
unsetopt correct
unsetopt correct_all
# ---
# kinda hacky way to traverse up to the root of the dotfiles repo
export DOTFILES="$(realpath "$(realpath "$(dirname "${0}")")/../..")"
export LC_ALL="${LC_ALL:-en_US.UTF-8}"
export LANG="${LANG:-en_US.UTF-8}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export HISTFILE="${HISTFILE:-$HOME/.zsh_history}"
export HISTSIZE=10000
export SAVEHIST=10000
export EDITOR="nano" # don't judge me
export VISUAL="code --new-window --wait"
export PAGER="less"
export LESS="$LESS -RF --mouse --silent"
# resolve GPG terminal at shell runtime
# fixes "signing failed: Inappropriate ioctl for device"
if tty -s 2>/dev/null; then
GPG_TTY=$(tty)
export GPG_TTY
fi
# https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/theme-and-appearance.zsh#L5
# export LS_COLORS="Gxfxcxdxbxegedabagacad"
-34
View File
@@ -1,34 +0,0 @@
#!/usr/bin/env zsh
# homebrew tweaks
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSECURE_REDIRECT=1
# docker tweaks
export DOCKER_BUILDKIT=1
export DOCKER_SCAN_SUGGEST=false
export COMPOSE_DOCKER_CLI_BUILD=1
# npm tweaks
export DISABLE_OPENCOLLECTIVE=1
export NO_UPDATE_NOTIFIER=1
export NPM_CONFIG_FUND=false
export NPM_CONFIG_UPDATE_NOTIFIER=false
export OPEN_SOURCE_CONTRIBUTOR=true
export OPENCOLLECTIVE_HIDE=1
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
# can everyone stop being so creepy pls
export AZURE_CORE_COLLECT_TELEMETRY=0
export CHECKPOINT_DISABLE=1
export CLI_COLLECT_METRICS=0
export CLOUDSDK_CORE_DISABLE_USAGE_REPORTING=true
export DOTNET_CLI_TELEMETRY_OPTOUT=true
export GATSBY_TELEMETRY_DISABLED=1
export NEXT_TELEMETRY_DISABLED=1
export POWERSHELL_TELEMETRY_OPTOUT=1
export SAM_CLI_TELEMETRY=0
export SLS_TELEMETRY_DISABLED=1
export VAGRANT_CHECKPOINT_DISABLE=1
export YARN_ENABLE_TELEMETRY=0
-103
View File
@@ -1,103 +0,0 @@
#!/usr/bin/env zsh
# Make a new directory and `cd` right into it (this seems like a no-brainer)
mkcd() {
mkdir -p "$1" && cd "$1"
}
# Load .env file into shell session for environment variables
# https://github.com/thoughtbot/dotfiles/blob/main/zsh/functions/envup
envup() {
if [ -f .env ]; then
export $(sed '/^ *#/ d' .env)
else
echo 'No .env file found' 1>&2
return 1
fi
}
# Start an HTTP server from a directory, optionally specifying the port
serve() {
local port="${1:-8090}"
sleep 1 && open "http://localhost:${port}/" &
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesn't break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
}
# Extract a compressed archive without worrying about which tool to use
extract() {
if [[ -f "$1" ]]; then
case "$1" in
*.tar.bz2)
tar xjf "$1"
;;
*.tar.gz)
tar xzf "$1"
;;
*.bz2)
bunzip2 "$1"
;;
*.rar)
unrar x "$1"
;;
*.gz)
gunzip "$1"
;;
*.tar)
tar xf "$1"
;;
*.tbz2)
tar xjf "$1"
;;
*.tgz)
tar xzf "$1"
;;
*.zip)
unzip "$1"
;;
*.Z)
uncompress "$1"
;;
*.7z)
7z x "$1"
;;
*)
echo "'$1' cannot be extracted via extract()"
;;
esac
else
echo "'$1' is not a valid file"
fi
}
# create a jrvs.io short URL
# ex: short https://github.com/jakejarvis/dotfiles jakesdotfiles => https://jrvs.io/jakesdotfiles
# https://github.com/jakejarvis/jrvs.io/blob/main/short.sh
short() {
( cd "$HOME/source/jrvs.io" && bash -c "./short.sh $*" )
}
# Create a git.io short URL (custom slug optional)
# ex: gitio https://github.com/jakejarvis/dotfiles [jakesdotfiles] => https://git.io/jakesdotfiles
# https://blog.github.com/2011-11-10-git-io-github-url-shortener
gitio() {
local PARAMS RESPONSE
PARAMS="-F \"url=$1\""
if [[ -n "$2" ]]; then
PARAMS="$PARAMS -F \"code=$2\""
fi
RESPONSE=$(eval "curl -i https://git.io $PARAMS 2>&1" | grep "Location: ")
echo "${RESPONSE//Location: /}"
}
# Push a local SSH public key to another machine
# https://github.com/rtomayko/dotfiles/blob/rtomayko/.bashrc
push_ssh_cert() {
local _host
[[ -f ~/.ssh/id_ed25519.pub ]] || ssh-keygen -t ed25519
for _host in "$@"; do
echo "$_host"
ssh "$_host" "\cat >> ~/.ssh/authorized_keys" < ~/.ssh/id_ed25519.pub
done
}
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env zsh
export BROWSER="/Applications/Firefox.app/Contents/MacOS/firefox"
# https://developer.1password.com/docs/ssh/get-started#step-4-configure-your-ssh-or-git-client
if [[ -S "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" ]]; then
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
fi
export HOMEBREW_CASK_OPTS="--appdir=/Applications" # --require-sha
export HOMEBREW_FORCE_BREWED_CURL=1
export HOMEBREW_FORCE_BREWED_GIT=1
# Rosetta hacks for M1
alias intel="arch -x86_64 /bin/zsh"
alias arm="arch -arm64 zsh"
system_update() {
local NC="\033[0m"
local YELLOW="\033[0;33m"
# homebrew
echo -e "${YELLOW}Updating Homebrew formulae and casks...${NC}"
brew update
brew upgrade
# avoid annoying `(latest) != latest` cask updates:
brew upgrade $(brew outdated --greedy --verbose | awk '$2 !~ /(latest)/ {print $1}')
brew cleanup
# node, npm, yarn
echo -e "${YELLOW}Updating global NPM/Yarn packages...${NC}"
fnm install --latest --corepack-enabled
npm update --global --no-audit
# ruby, gems
echo -e "${YELLOW}Updating Ruby and gems...${NC}"
CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS" \
rbenv install --skip-existing "$(rbenv install -l | grep -v - | tail -1)" && \
rbenv global "$(rbenv install -l | grep -v - | tail -1)"
gem install bundler foreman
gem update
gem cleanup
rbenv rehash
# pips
# https://stackoverflow.com/a/3452888
echo -e "${YELLOW}Updating pip packages...${NC}"
pip3 list --outdated --format=json | jq -r '.[] | .name+"="+.latest_version' | cut -d = -f 1 | xargs -n1 pip3 install -U
# zinit & plugins
echo -e "${YELLOW}Updating zinit...${NC}"
zinit self-update
zinit update --all
# App Store
echo -e "${YELLOW}Checking for App Store updates...${NC}"
mas outdated
# macOS system
echo -e "${YELLOW}Checking for macOS system updates...${NC}"
softwareupdate --list
}
alias unhidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias rehidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
alias force_empty="sudo rm -rf ~/.Trash /Volumes/*/.Trashes"
alias unq="sudo xattr -rd com.apple.quarantine"
# hide/show all desktop icons (useful when presenting)
alias hidedesk="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesk="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias ripfinder="killall Finder"
alias ripdock="killall Dock"
alias ripmenu="killall SystemUIServer NotificationCenter"
# open current directory in Finder
alias finder="open -a Finder ."
alias dns-clear="networksetup -setdnsservers Wi-Fi"
alias dns-check="networksetup -getdnsservers Wi-Fi"
alias dns-set="networksetup -setdnsservers Wi-Fi "
alias dns-set-cloudflare="dns-set 1.1.1.1 1.0.0.1"
alias dns-set-google="dns-set 8.8.8.8 8.8.4.4"
alias flush="sudo killall -HUP mDNSResponder; sudo killall mDNSResponderHelper; sudo dscacheutil -flushcache"
# Xcode simulators
alias ios_sim="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"
alias watchos_sim="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator\ \(Watch\).app"
# convenient access to ssh public key
alias pubkey="pbcopy < ~/.ssh/id_ed25519.pub && echo '=> Public key copied to clipboard.'"
# workaround for lack of tailscale CLI on mac:
# https://tailscale.com/kb/1080/cli/?tab=macos#using-the-cli
alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
-135
View File
@@ -1,135 +0,0 @@
#!/usr/bin/env zsh
# Homebrew's location is different depending on OS...
# https://github.com/Homebrew/install/blob/master/install.sh#L122
if [[ -d /opt/homebrew ]]; then
# macOS on Apple Silicon
BREW_BIN="/opt/homebrew/bin/brew"
elif [[ -d "$HOME/.linuxbrew" ]]; then
# Linux, user install
# NOTE: definitely discouraged, maybe deprecated? https://github.com/Homebrew/install/pull/702
BREW_BIN="$HOME/.linuxbrew/bin/brew"
elif [[ -d /home/linuxbrew/.linuxbrew ]]; then
# Linux, system install
BREW_BIN="/home/linuxbrew/.linuxbrew/bin/brew"
else
# macOS on Intel (hopefully, or else we're kinda doomed...)
BREW_BIN="/usr/local/bin/brew"
fi
# set PATHs for Homebrew (if we found it)
if [[ -x "$BREW_BIN" ]]; then
eval "$("$BREW_BIN" shellenv)"
# macOS-only remedies
if [[ "$OSTYPE" = darwin* ]]; then
# manually add VS Code 'code' command to path
# https://code.visualstudio.com/docs/setup/mac#_alternative-manual-instructions
if [[ -d "/Applications/Visual Studio Code.app/Contents/Resources/app/bin" ]]; then
path=("/Applications/Visual Studio Code.app/Contents/Resources/app/bin" $path)
fi
# remap macOS core utils to GNU equivalents without needing the 'g' prefix (e.g. ggrep -> grep):
# https://gist.github.com/skyzyx/3438280b18e4f7c490db8a2a2ca0b9da?permalink_comment_id=3049694#gistcomment-3049694
for gnubin in "$(brew --prefix)"/opt/*/libexec/gnubin; do
path=($gnubin $path)
done
# ensure man also points to the GNU manuals
for gnuman in "$(brew --prefix)"/opt/*/libexec/gnuman; do
manpath=($gnuman $manpath)
done
# declare the base xcode & homebrew paths first
LDFLAGS="${LDFLAGS:+"$LDFLAGS "}-L$(brew --prefix)/lib"
CFLAGS="${CPPFLAGS:+"$CPPFLAGS "}-I$(brew --prefix)/include -I$(brew --prefix openjdk)/include"
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}$(brew --prefix)/lib/pkgconfig"
# tell compilers and pkg-config where to find the homebrew versions (rather than the vendored macOS versions) of the
# following packages:
declare -a compiler_libs=(
bzip2
curl
jemalloc
libffi
gettext
libxml2
ncurses
openssl@1.1
readline
sqlite
tcl-tk
icu4c
xz
zlib
)
# append the specific paths for each of the above libraries
for lib in $compiler_libs; do
# TODO: 'brew --prefix' got pretty slow in Homebrew v4, so these calls should be cleaned up/optimized
# https://github.com/Homebrew/brew/commit/ca32473a672ef08be60792a921a3a1e4dcc32e13
LDFLAGS+=" -L$(brew --prefix $lib)/lib"
CFLAGS+=" -I$(brew --prefix $lib)/include"
PKG_CONFIG_PATH+=":$(brew --prefix $lib)/lib/pkgconfig"
done
# it's easier to do ruby opts separately as it needs different libraries than above in a very different format
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline) --with-jemalloc-dir=$(brew --prefix jemalloc) --with-libffi-dir=$(brew --prefix libffi) --with-libyaml-dir=$(brew --prefix libyaml) $RUBY_CONFIGURE_OPTS"
# add xcode flags last
if command -v xcrun &>/dev/null; then
LDFLAGS+=" -L$(xcrun --show-sdk-path)/usr/lib"
CFLAGS+=" -I$(xcrun --show-sdk-path)/usr/include"
PKG_CONFIG_PATH+=":$(brew --prefix $lib)/lib/pkgconfig"
fi
# finally all done with this mess
export LDFLAGS CPPFLAGS PKG_CONFIG_PATH RUBY_CONFIGURE_OPTS
unset gnubin gnuman compiler_libs lib
fi
fi
# go
if [[ -d "$HOME/golang" ]]; then
export GOPATH="$HOME/golang"
path=("$GOPATH/bin" $path)
fi
# rust/cargo
if [[ -d "$HOME/.cargo" ]]; then
path=("$HOME/.cargo/bin" $path)
fi
# fnm
if command -v fnm &>/dev/null; then
eval "$(fnm env --use-on-cd --shell zsh)"
fi
# rbenv
if command -v rbenv &>/dev/null; then
eval "$(rbenv init - --no-rehash zsh)"
fi
# pyenv
if command -v pyenv &>/dev/null; then
eval "$(pyenv init - --no-rehash zsh)"
# pyenv-virtualenv
if command -v pyenv-virtualenv-init &>/dev/null; then
eval "$(pyenv virtualenv-init - zsh)"
fi
fi
# pnpm
if [[ -d "$HOME/.local/share/pnpm" ]]; then
path=("$HOME/.local/share/pnpm" $path)
fi
# docker user mode, see: https://docs.docker.com/desktop/mac/permission-requirements/#installing-symlinks
if [[ -d "$HOME/.docker/bin" ]]; then
path=("$HOME/.docker/bin" $path)
fi
# let zsh sort out formatting and deduplication
typeset -aU path fpath manpath
export PATH FPATH MANPATH
-340
View File
@@ -1,340 +0,0 @@
#!/usr/bin/env zsh
# these custom values must be set *before* sourcing zinit
export ZINIT_HOME="${ZINIT_HOME:-"${XDG_DATA_HOME:-"${HOME}/.local/share"}/zinit/zinit.git"}"
declare -A ZINIT=(
[ZCOMPDUMP_PATH]="${XDG_CACHE_HOME:-"$HOME/.cache"}/zsh/.zcompdump-$ZSH_VERSION"
)
# check for zinit
if [[ -f "$ZINIT_HOME/zinit.zsh" ]]; then
source "$ZINIT_HOME/zinit.zsh"
else
echo "zinit not found in '$ZINIT_HOME', either check the value of ZINIT_HOME or install zinit."
return
fi
# initialize zinit && ensure compinit recognizes its completions
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# TODO: figure out why zinit stopped adding itself to MANPATH automatically...
if [[ -d "${ZINIT[MAN_DIR]}" ]]; then
manpath=(
"${ZINIT[MAN_DIR]}"
$manpath
)
fi
# various zinit add-ons
zinit light zdharma-continuum/zinit-annex-patch-dl
# oh-my-zsh was good at setting iTerm tab titles, keep doing it pls
# https://github.com/ohmyzsh/ohmyzsh/tree/master/lib
zinit snippet OMZ::lib/functions.zsh
zinit snippet OMZ::lib/termsupport.zsh
zinit snippet OMZ::lib/compfix.zsh
# async support
zinit ice lucid depth"1" \
atload"async_init" \
src"async.zsh"
zinit light mafredri/zsh-async
# grab exa (better ls) binary
zinit ice lucid from"gh-r" as"command" \
mv"bin/exa* -> exa" \
atclone"
mv -vf completions/exa.zsh _exa
mv -vf man/exa.1 ${ZINIT[MAN_DIR]}/man1
mv -vf man/exa_colors.5 ${ZINIT[MAN_DIR]}/man5
" \
atpull"%atclone" \
atload"
alias ls='exa --color=auto -GF --icons --group-directories-first'
alias ll='exa --color=auto -1laF --git --icons --group-directories-first --ignore-glob=\".DS_Store*|~*\"'
alias lt='ll -T -L=2'
"
zinit light ogham/exa
# grab bat (better cat) binary
zinit ice lucid from"gh-r" as"command" \
mv"bat-*/bat -> bat" \
atclone"
mv -vf bat-*/autocomplete/bat.zsh _bat
mv -vf bat-*/bat.1 ${ZINIT[MAN_DIR]}/man1
" \
atpull"%atclone" \
atload"
export BAT_THEME='base16'
export MANPAGER='sh -c \"col -bx | bat --color=always --style=plain --language=man\"'
alias cat='bat --paging=always --color=auto --style=numbers,changes'
alias plcat='bat --paging=never --color=auto --style=plain'
"
zinit light sharkdp/bat
# grab delta binary
zinit ice lucid from"gh-r" as"command" \
mv"delta-*/delta -> delta" \
dl"https://github.com/dandavison/delta/raw/HEAD/etc/completion/completion.zsh -> _delta"
zinit light dandavison/delta
# grab fd binary
zinit ice lucid from"gh-r" as"command" \
mv"fd-*/fd -> fd" \
atclone"
mv -vf fd-*/autocomplete/_fd _fd
mv -vf fd-*/fd.1 ${ZINIT[MAN_DIR]}/man1
" \
atpull"%atclone"
zinit light sharkdp/fd
# grab fzf binary from release & other files from source
# TODO: preview commands are an absolute sh*tshow, maybe use .lessfilter?
# https://github.com/Aloxaf/fzf-tab/wiki/Preview#show-file-contents
zinit ice lucid from"gh-r" as"command" \
dl"https://github.com/junegunn/fzf/raw/HEAD/shell/key-bindings.zsh -> key-bindings.zsh" \
dl"https://github.com/junegunn/fzf/raw/HEAD/shell/completion.zsh -> _fzf" \
dl"https://github.com/junegunn/fzf/raw/HEAD/man/man1/fzf.1 -> ${ZINIT[MAN_DIR]}/man1/fzf.1" \
dl"https://github.com/junegunn/fzf/raw/HEAD/man/man1/fzf-tmux.1 -> ${ZINIT[MAN_DIR]}/man1/fzf-tmux.1" \
atload'
export FZF_FD_OPTS="--color always --hidden --follow --exclude .git --exclude node_modules"
export FZF_PREVIEW_FILE_COMMAND="bat --color=always --paging=never --style=plain"
export FZF_PREVIEW_DIR_COMMAND="exa -1a --color=always --icons --group-directories-first"
export FZF_DEFAULT_OPTS="--cycle --select-1 --exit-0 --height=60% --no-mouse --bind=\"tab:accept,ctrl-y:preview-page-up,ctrl-v:preview-page-down,ctrl-e:execute-silent(\${VISUAL:-\$EDITOR} {+} >/dev/null 2>&1)\""
export FZF_DEFAULT_COMMAND="fd --type f $FZF_FD_OPTS"
export FZF_ALT_C_OPTS="-i --ansi --preview=\"$FZF_PREVIEW_DIR_COMMAND {}\""
export FZF_ALT_C_COMMAND="fd --type d . $FZF_FD_OPTS"
export FZF_CTRL_T_OPTS="-i --ansi --bind=\"ctrl-w:execute(\$EDITOR {1} >/dev/tty </dev/tty)+refresh-preview\" --preview=\"$FZF_PREVIEW_FILE_COMMAND {} 2>/dev/null\""
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
' \
src"key-bindings.zsh"
zinit light junegunn/fzf
# zoxide
zinit ice wait"0b" lucid from"gh-r" as"command" \
atclone"
mv -vf man/man1/zoxide* ${ZINIT[MAN_DIR]}/man1
./zoxide init zsh > init.zsh
zcompile init.zsh
" \
atpull"%atclone" \
atinit'
export _ZO_DATA_DIR="${XDG_DATA_HOME:-"$HOME/.local/share"}/zoxide"
export _ZO_FZF_OPTS="$FZF_DEFAULT_OPTS --exact --no-sort --ansi --reverse --preview=\"$FZF_PREVIEW_DIR_COMMAND {2..}\""
' \
src"init.zsh"
zinit light ajeetdsouza/zoxide
# grab vivid binary (for all the colors)
# https://github.com/sharkdp/vivid/tree/master/themes
# by outputting the generated LS_COLORS variable to a file and sourcing it, we only need to call vivid once on
# installation rather than every time a new session begins.
zinit ice lucid from"gh-r" as"command" \
mv"vivid-*/vivid -> vivid" \
atclone"
./vivid generate snazzy | xargs printf 'export LS_COLORS=%q' > colors.zsh
" \
atpull"%atclone" \
atload"zstyle ':completion:*' list-colors \${(s.:.)LS_COLORS}" \
src"colors.zsh"
zinit light sharkdp/vivid
# better Ctrl+R history searching
zinit ice wait lucid depth"1" \
atload"
zstyle ':history-search-multi-word' highlight-color 'fg=yellow,bold'
zstyle ':history-search-multi-word' page-size 15
zstyle ':plugin:history-search-multi-word' active 'standout'
zstyle ':plugin:history-search-multi-word' reset-prompt-protect 1
" \
trackbinds
zinit light zdharma-continuum/history-search-multi-word
# tab completions via fzf
zinit ice wait"0b" lucid depth"1" \
has"fzf" \
blockf \
atpull"zinit creinstall -q ." \
atload"
zstyle ':completion:*' verbose true
zstyle ':completion:*' use-cache true
zstyle ':completion:*' cache-path '$(dirname ${ZINIT[ZCOMPDUMP_PATH]})/.zcompcache'
zstyle ':completion:*' rehash true
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' list-dirs-first true
zstyle ':completion:*' keep-prefix true
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*:descriptions' format '%d'
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion::complete:*:*:files' ignored-patterns '.DS_Store' 'Icon?'
zstyle ':completion::complete:*:*:globbed-files' ignored-patterns '.DS_Store' 'Icon?'
zstyle ':completion::complete:rm:*:globbed-files' ignored-patterns
zstyle ':fzf-tab:*' fzf-command 'fzf'
zstyle ':fzf-tab:*' fzf-flags $FZF_DEFAULT_OPTS '-i' '--ansi'
zstyle ':fzf-tab:*' fzf-bindings \
'tab:accept' \
'ctrl-y:preview-page-up' \
'ctrl-v:preview-page-down' \
'ctrl-e:execute-silent(\${VISUAL:-\$EDITOR} \$realpath >/dev/null 2>&1)' \
'ctrl-w:execute(\$EDITOR \$realpath >/dev/tty </dev/tty)+refresh-preview'
zstyle ':fzf-tab:*' fzf-min-height 15
zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-preview \
'git diff --no-ext-diff \$word | delta --paging=never --no-gitconfig --line-numbers --file-style=omit --hunk-header-style=omit --theme=base16'
zstyle ':fzf-tab:complete:git-log:*' fzf-preview \
'git --no-pager log --color=always --format=oneline --abbrev-commit --follow \$word'
zstyle ':fzf-tab:complete:man:*' fzf-preview \
'man -P \"col -bx\" \$word | $FZF_PREVIEW_FILE_COMMAND --language=man'
zstyle ':fzf-tab:complete:brew-(install|uninstall|search|info):*-argument-rest' fzf-preview \
'brew info \$word'
zstyle ':fzf-tab:complete:(-command-|-parameter-|-brace-parameter-|export|unset|expand):*' fzf-preview \
'echo \${(P)word}'
zstyle ':fzf-tab:complete:*:options' fzf-preview
zstyle ':fzf-tab:complete:*:options' fzf-flags '--no-preview'
zstyle ':fzf-tab:complete:*:argument-1' fzf-preview
zstyle ':fzf-tab:complete:*:argument-1' fzf-flags '--no-preview'
zstyle ':fzf-tab:complete:*:*' fzf-preview \
'($FZF_PREVIEW_FILE_COMMAND \$realpath || $FZF_PREVIEW_DIR_COMMAND \$realpath) 2>/dev/null'
"
zinit light Aloxaf/fzf-tab
# fix git-* completions, apparently there's some conflict with brew's git
# TODO: investigate more... https://github.com/Aloxaf/fzf-tab/wiki/Preview#git
zinit ice wait lucid as"null" \
atload'zstyle ":completion:*:*:git:*" script "$(pwd)/git-completion.bash"'
zinit snippet https://github.com/git/git/raw/HEAD/contrib/completion/git-completion.bash
# grab completions as snippets from GitHub repos
zinit wait lucid as"completion" \
atpull"zinit creinstall -q ." \
nocompile \
for \
has"bundle" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_bundle \
has"conda" https://github.com/conda-incubator/conda-zsh-completion/raw/HEAD/_conda \
has"docker" https://github.com/docker/cli/raw/HEAD/contrib/completion/zsh/_docker \
has"golang" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_golang \
has"nano" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_nano \
has"node" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_node \
has"nvm" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_nvm \
has"psql" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_pgsql_utils \
has"rails" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_rails \
has"rbenv" https://github.com/rbenv/rbenv/raw/HEAD/completions/_rbenv \
has"redis-cli" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_redis-cli \
has"shellcheck" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_shellcheck \
has"vagrant" https://github.com/hashicorp/vagrant/raw/HEAD/contrib/zsh/_vagrant \
has"yarn" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_yarn \
has"git" mv"git-completion.zsh -> _git" https://github.com/git/git/raw/HEAD/contrib/completion/git-completion.zsh \
has"pyenv" mv"pyenv.zsh -> _pyenv" https://github.com/pyenv/pyenv/raw/HEAD/completions/pyenv.zsh \
if'[[ "$OSTYPE" = linux-gnu* ]]' has"fail2ban-client" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_fail2ban-client \
if'[[ "$OSTYPE" = linux-gnu* ]]' has"ufw" https://github.com/zsh-users/zsh-completions/raw/HEAD/src/_ufw \
if'[[ "$OSTYPE" = darwin* ]]' has"security" https://github.com/ohmyzsh/ohmyzsh/raw/HEAD/plugins/macos/_security \
# generate other completions from externally installed programs
zinit wait lucid as"completion" \
atpull"zinit creinstall -q ." \
nocompile \
for \
has"doctl" id-as"_local/completions/doctl" atclone"doctl completion zsh > _doctl" zdharma-continuum/null \
has"fnm" id-as"_local/completions/fnm" atclone"fnm completions --shell zsh > _fnm" zdharma-continuum/null \
has"gh" id-as"_local/completions/gh" atclone"gh completion -s zsh > _gh" zdharma-continuum/null \
has"glab" id-as"_local/completions/glab" atclone"glab completion -s zsh > _glab" zdharma-continuum/null \
has"helm" id-as"_local/completions/helm" atclone"helm completion zsh > _helm" zdharma-continuum/null \
has"hugo" id-as"_local/completions/hugo" atclone"hugo completion zsh > _hugo" zdharma-continuum/null \
has"kubectl" id-as"_local/completions/kubectl" atclone"kubectl completion zsh > _kubectl" zdharma-continuum/null \
has"minikube" id-as"_local/completions/minikube" atclone"minikube completion zsh > _minikube" zdharma-continuum/null \
has"ng" id-as"_local/completions/ng" atclone"ng completion script > _ng" zdharma-continuum/null \
has"op" id-as"_local/completions/op" atclone"op completion zsh > _op" zdharma-continuum/null \
has"pip" id-as"_local/completions/pip" atclone"pip completion --zsh > pip" zdharma-continuum/null \
has"pnpm" id-as"_local/completions/pnpm" atclone"pnpm completion zsh > _pnpm" zdharma-continuum/null \
has"pscale" id-as"_local/completions/pscale" atclone"pscale completion zsh > _pscale" zdharma-continuum/null \
has"rustup" id-as"_local/completions/rustup" atclone"rustup completions zsh > _rustup" zdharma-continuum/null \
has"supabase" id-as"_local/completions/supabase" atclone"supabase completion zsh > _supabase" zdharma-continuum/null \
has"tailscale" id-as"_local/completions/tailscale" atclone"tailscale completion zsh > _tailscale" zdharma-continuum/null
# fix git-* completions, apparently there's some conflict with brew's git
# TODO: investigate more... https://github.com/Aloxaf/fzf-tab/wiki/Preview#git
zinit ice wait lucid as"null" \
atload'zstyle ":completion:*:*:git:*" script "$(pwd)/git-completion.bash"'
zinit snippet https://github.com/git/git/raw/HEAD/contrib/completion/git-completion.bash
# macOS-only completion fixes
zinit ice wait lucid as"null" \
id-as"_local/extra/mac" \
if'[[ "$OSTYPE" = darwin* ]]' \
atload"
zstyle ':completion:*:*:*:*:processes' command 'ps -o comm=\"\" -w -w'
zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \
'[[ \$group == \"process ID\" ]] && ps -p\$word -o comm=\"\" -w -w'
"
zinit light zdharma-continuum/null
# Linux-only completion fixes
zinit ice wait lucid as"null" \
id-as"_local/extra/linux" \
if'[[ "$OSTYPE" = linux-gnu* ]]' \
atload"
zstyle ':completion:*:*:*:*:processes' command 'ps -o cmd --no-headers -w -w'
zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \
'[[ \$group == \"process ID\" ]] && ps --pid=\$word -o cmd --no-headers -w -w'
zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status \$word'
"
zinit light zdharma-continuum/null
# autopairing of quotes, brackets, etc.
zinit ice wait"0b" lucid depth"1" \
atload"ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(autopair-insert)"
zinit light hlissner/zsh-autopair
# syntax highlighting
zinit ice wait lucid depth"1" \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
atload"
zle_highlight+=('paste:reverse')
zstyle ':plugin:fast-syntax-highlighting' theme ''
typeset -gA FAST_HIGHLIGHT_STYLES
FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME:-}variable]='fg=cyan,bold'
"
zinit light zdharma-continuum/fast-syntax-highlighting
# autosuggestions, trigger precmd hook upon load
zinit ice wait"0a" lucid depth"1" \
atinit"
export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
export ZSH_AUTOSUGGEST_MANUAL_REBIND=1
export ZSH_AUTOSUGGEST_USE_ASYNC=1
" \
atload"_zsh_autosuggest_start"
zinit light zsh-users/zsh-autosuggestions
# 1Password plugins: https://developer.1password.com/docs/cli/shell-plugins/
# NOTE: this needs to happen *after* generating the completions above, otherwise it'll ask for touch ID to do very
# simple tasks...
zinit ice wait"1" lucid \
id-as"_local/op-auth" \
has"op" \
if"[[ -f ~/.config/op/plugins.sh ]]" \
nocompile
zinit snippet ~/.config/op/plugins.sh
# iTerm2 integration
zinit ice lucid depth"1" \
if'[[ "$TERM_PROGRAM" = "iTerm.app" ]]' \
atload'path=("$(pwd)/utilities" $path)' \
src"shell_integration/zsh" \
nocompile
zinit light gnachman/iTerm2-shell-integration
# starship prompt
zinit ice from"gh-r" as"command" \
atclone"
./starship completions zsh > _starship
./starship init zsh --print-full-init > init.zsh
zcompile init.zsh
" \
atpull"%atclone" \
src"init.zsh"
zinit light starship/starship