Skip to content

Instantly share code, notes, and snippets.

@vinayakg
Last active February 20, 2026 10:02
Show Gist options
  • Select an option

  • Save vinayakg/b9bd0702eedff93ca169c1462dde0a93 to your computer and use it in GitHub Desktop.

Select an option

Save vinayakg/b9bd0702eedff93ca169c1462dde0a93 to your computer and use it in GitHub Desktop.
MAC OS Setup FIles
# ============================================================================
# AeroSpace Configuration
# Tiling Window Manager for macOS
# Documentation: https://nikitabobko.github.io/AeroSpace/guide
# ============================================================================
# ----------------------------------------------------------------------------
# Startup & General Settings
# ----------------------------------------------------------------------------
# Commands to run after AeroSpace starts
after-startup-command = []
# Start AeroSpace at login
start-at-login = true
# Normalizations keep layouts clean and predictable
# See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
# Accordion layout padding (set 0 to disable)
accordion-padding = 30
# Default layout: tiles or accordion
default-root-container-layout = 'tiles'
# Default orientation: horizontal, vertical, or auto
# 'auto' = wide monitors get horizontal, tall monitors get vertical
default-root-container-orientation = 'auto'
# Mouse follows focus when switching monitors
# See: https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# Disable macOS "Hide application" (cmd-h) workaround
# See: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = false
# ----------------------------------------------------------------------------
# Keyboard Layout
# ----------------------------------------------------------------------------
# Possible values: qwerty, dvorak, colemak
# See: https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'
# ----------------------------------------------------------------------------
# Gaps Configuration
# ----------------------------------------------------------------------------
# Gaps between windows (inner) and monitor edges (outer)
# Supports per-monitor values - see documentation for details
[gaps]
inner.horizontal = 10
inner.vertical = 10
outer.left = 10
outer.bottom = 10
outer.top = 10
outer.right = 10
# ============================================================================
# MAIN MODE KEYBINDINGS
# ============================================================================
[mode.main.binding]
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon,
# backtick, leftSquareBracket, rightSquareBracket, space, enter, esc,
# backspace, tab, pageUp, pageDown, home, end, forwardDelete,
# sectionSign (ISO keyboards only, european keyboards only)
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right
# All possible modifiers: cmd, alt, ctrl, shift
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
# ------------------------------------------------------------------------
# Window Navigation (vim-style hjkl)
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'
# ------------------------------------------------------------------------
# Window Swap
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#swap
# Swap in main mode
ctrl-shift-h = 'swap left'
ctrl-shift-j = 'swap down'
ctrl-shift-k = 'swap up'
ctrl-shift-l = 'swap right'
# ------------------------------------------------------------------------
# Window Resizing
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-minus = 'resize smart -50'
alt-equal = 'resize smart +50'
# ------------------------------------------------------------------------
# Layout Controls
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-ctrl-h = 'layout horizontal' # Force horizontal split
alt-ctrl-v = 'layout vertical' # Force vertical split
# Balance window sizes in workspace
alt-0 = 'balance-sizes'
# Flatten all nested containers (simplify layout)
alt-shift-0 = 'flatten-workspace-tree'
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# ------------------------------------------------------------------------
# Workspace Navigation & App Launchers
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# Development Tools
alt-1 = 'exec-and-forget open -a /Applications/Visual\ Studio\ Code.app'
alt-2 = 'exec-and-forget open -a /Applications/Ghostty.app'
alt-d = 'exec-and-forget open -a /Applications/Dbeaver.app'
alt-r = 'exec-and-forget open -a /Applications/ResponsivelyApp.app'
# Browsers
alt-3 = 'exec-and-forget open -a /Applications/Brave\ Browser.app/'
alt-b = 'exec-and-forget open -a /Applications/Firefox.app'
# Communication
alt-4 = 'exec-and-forget open -a /Applications/Microsoft\ Outlook.app'
alt-5 = 'exec-and-forget open -a /Applications/Microsoft\ Teams.app'
alt-w = 'exec-and-forget open -a /Applications/WhatsApp.app'
alt-z = 'exec-and-forget open -a /Applications/zoom.us.app'
# Google & AI Apps (Brave PWAs)
alt-6 = 'exec-and-forget open -b com.brave.Browser.app.fmgjjmmmlfnkbppncabfkddbjimcfncm' # GMAIL
alt-7 = 'exec-and-forget open -b com.brave.Browser.app.kpmdbogdmbfckbgdfdffkleoleokbhod' # PERPLEXITY
alt-8 = 'exec-and-forget open -b com.brave.Browser.app.fmpnliohjhemenmnlpbfagaolkdacoja' # CLAUDE
alt-9 = 'exec-and-forget open -a /Applications/ChatGPT.app'
alt-t = 'exec-and-forget open -b com.brave.Browser.app.ibblmnobmgdmpoeblocemifbpglakpoi'
alt-x = 'exec-and-forget open -b com.brave.Browser.app.lodlkdfmihgonocnmddehnfgiljnadcf'
# Productivity & Utilities
alt-a = 'exec-and-forget open -a /Applications/Utilities/Activity\ Monitor.app/'
alt-e = 'exec-and-forget open -a /Applications/Microsoft\ Excel.app'
alt-m = 'exec-and-forget open -a /Applications/Meld.app'
alt-n = 'exec-and-forget open -a /Applications/Microsoft\ OneNote.app/'
alt-o = 'exec-and-forget open -a /Applications/Overcast.app/'
alt-p = 'exec-and-forget open -a /Applications/Preview.app'
alt-y = 'exec-and-forget open -a /Applications/FreeTube.app'
# Workspaces without dedicated apps
alt-c = 'workspace C'
alt-f = 'workspace F'
alt-g = 'workspace G'
alt-i = 'workspace I'
alt-q = 'workspace Q'
alt-s = 'workspace S'
alt-u = 'workspace U'
alt-v = 'workspace V'
# You can uncomment the following lines to open up terminal with alt + enter shortcut
# (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''
# ------------------------------------------------------------------------
# Move Window to Workspace
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'
alt-shift-a = 'move-node-to-workspace A'
alt-shift-b = 'move-node-to-workspace B'
alt-shift-c = 'move-node-to-workspace C'
alt-shift-d = 'move-node-to-workspace D'
alt-shift-e = 'move-node-to-workspace E'
alt-shift-f = 'move-node-to-workspace F'
alt-shift-g = 'move-node-to-workspace G'
alt-shift-i = 'move-node-to-workspace I'
alt-shift-m = 'move-node-to-workspace M'
alt-shift-n = 'move-node-to-workspace N'
alt-shift-o = 'move-node-to-workspace O'
alt-shift-p = 'move-node-to-workspace P'
alt-shift-q = 'move-node-to-workspace Q'
alt-shift-r = 'move-node-to-workspace R'
alt-shift-s = 'move-node-to-workspace S'
alt-shift-t = 'move-node-to-workspace T'
alt-shift-u = 'move-node-to-workspace U'
alt-shift-v = 'move-node-to-workspace V'
alt-shift-w = 'move-node-to-workspace W'
alt-shift-x = 'move-node-to-workspace X'
alt-shift-y = 'move-node-to-workspace Y'
alt-shift-z = 'move-node-to-workspace Z'
# ------------------------------------------------------------------------
# Workspace Switching
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = 'workspace-back-and-forth'
# Multi-monitor workspace movement (uncomment if using multiple monitors)
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
# alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'
# ------------------------------------------------------------------------
# Enter Service Mode
# ------------------------------------------------------------------------
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
alt-shift-semicolon = 'mode service'
# ============================================================================
# SERVICE MODE KEYBINDINGS
# ============================================================================
# Service mode provides advanced window manipulation commands
# Enter with: Alt-Shift-;
# Exit with: Esc (also reloads config)
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
#s = ['layout sticky tiling', 'mode main']
# Join windows - essential for creating grid layouts (2x2, 3x2, etc.)
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
# Volume controls
down = 'volume down'
up = 'volume up'
shift-down = ['volume set 0', 'mode main']
# ============================================================================
# WINDOW DETECTION RULES
# ============================================================================
# Automatically move windows to designated workspaces when they open
# Find app-id with: mdls -name kMDItemCFBundleIdentifier /Applications/AppName.app
#[[on-window-detected]]
# check-further-callbacks = true
# run = 'layout floating'
# ----------------------------------------------------------------------------
# Development Tools
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.microsoft.VSCode'
run = ['move-node-to-workspace 1']
[[on-window-detected]]
if.app-id = 'com.googlecode.iterm2'
run = 'move-node-to-workspace 2'
[[on-window-detected]]
if.app-id = 'com.jetbrains.intellij.ce'
run = ['move-node-to-workspace I'] # mnemonics I - IDE
[[on-window-detected]]
if.app-id = 'com.jetbrains.pycharm.ce'
run = ['move-node-to-workspace I']
[[on-window-detected]]
if.app-id = 'com.todesktop.230313mzl4w4u92'
run = 'move-node-to-workspace C' # Cursor
[[on-window-detected]]
if.app-id = 'org.jkiss.dbeaver.core.product'
run = 'move-node-to-workspace D'
[[on-window-detected]]
if.app-id = 'dev.kdrag0n.MacVirt'
run = 'move-node-to-workspace D'
[[on-window-detected]]
if.app-id = 'app.responsively'
run = 'move-node-to-workspace R'
# ----------------------------------------------------------------------------
# Browsers
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.brave.Browser'
run = ['move-node-to-workspace 3'] # mnemonics W - Web browser
[[on-window-detected]]
if.app-id = 'org.mozilla.firefox'
run = ['move-node-to-workspace B'] # mnemonics W - Web browser
# ----------------------------------------------------------------------------
# Communication & Email
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-name-regex-substring = 'com.microsoft.Outlook'
run = 'move-node-to-workspace 4'
[[on-window-detected]]
if.app-id = 'com.microsoft.teams2'
run = 'move-node-to-workspace 5'
[[on-window-detected]]
if.app-id = 'net.whatsapp.WhatsApp'
run = 'move-node-to-workspace W'
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.ibblmnobmgdmpoeblocemifbpglakpoi'
run = 'move-node-to-workspace T'
[[on-window-detected]]
if.app-id = 'com.apple.MobileSMS'
run = 'move-node-to-workspace W'
[[on-window-detected]]
if.app-id = 'us.zoom.xos'
run = 'move-node-to-workspace Z'
[[on-window-detected]]
if.app-id = 'com.apple.mail'
run = ['move-node-to-workspace M']
# ----------------------------------------------------------------------------
# Google Apps (Brave PWAs)
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.fmgjjmmmlfnkbppncabfkddbjimcfncm'
run = 'move-node-to-workspace 6' #GMAIL
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.pmcngklofgngifnoceehmchjlildnhkj'
run = 'move-node-to-workspace 6' #Google Contacts
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.kjgfgldnnfoeklkmfkjfagphfepbbdan'
run = 'move-node-to-workspace 6' #Google Meet
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.jenjnolmmadjmjpcmkkhfehpjfdhoadg'
run = 'move-node-to-workspace 6' #GCP
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.aghbiahbpaijignceidepookljebhfak'
run = 'move-node-to-workspace 6' #G DRIVE
# ----------------------------------------------------------------------------
# AI Tools
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.kpmdbogdmbfckbgdfdffkleoleokbhod'
run = 'move-node-to-workspace 7' #Perplexity
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.fmpnliohjhemenmnlpbfagaolkdacoja'
run = 'move-node-to-workspace 8' #CLAUDE
[[on-window-detected]]
if.app-id = 'com.openai.chat'
run = 'move-node-to-workspace 9' # OPENAI
# ----------------------------------------------------------------------------
# Productivity & Office
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.microsoft.Excel'
run = ['move-node-to-workspace E']
[[on-window-detected]]
if.app-id = 'com.microsoft.onenote.mac'
run = 'move-node-to-workspace N'
[[on-window-detected]]
if.app-id = 'abnerworks.Typora'
run = 'move-node-to-workspace T'
[[on-window-detected]]
if.app-id = 'com.apple.iCal'
run = 'move-node-to-workspace C'
# ----------------------------------------------------------------------------
# Utilities & System
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.apple.ActivityMonitor'
run = ['move-node-to-workspace A']
[[on-window-detected]]
if.app-id = 'com.apple.finder'
run = ['move-node-to-workspace F']
[[on-window-detected]]
if.app-id = 'com.apple.Preview'
run = ['move-node-to-workspace P']
[[on-window-detected]]
if.app-id = 'com.coteditor.CotEditor'
run = 'move-node-to-workspace A'
[[on-window-detected]]
if.app-id = 'com.neohtop.dev'
run = 'move-node-to-workspace T' # TOP
[[on-window-detected]]
if.app-id = 'org.gnome.Meld'
run = 'move-node-to-workspace M'
[[on-window-detected]]
if.app-id = 'com.apple.iBooksX'
run = 'move-node-to-workspace A'
# ----------------------------------------------------------------------------
# Security & VPN
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'org.keepassxc.keepassxc'
run = 'move-node-to-workspace V'
[[on-window-detected]]
if.app-id = 'com.wireguard.macos'
run = 'move-node-to-workspace V'
[[on-window-detected]]
if.app-id = 'com.fortinet.forticlient.vpn'
run = 'move-node-to-workspace V'
# ----------------------------------------------------------------------------
# Media & Entertainment
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'io.freetubeapp.freetube'
run = ['move-node-to-workspace Y']
[[on-window-detected]]
if.app-id = 'fm.overcast.overcast'
run = 'move-node-to-workspace O' #Overcast
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.agimnkijcaahngcdmfeangaknmldooml'
run = 'move-node-to-workspace Y' #YOUTUBE
# ----------------------------------------------------------------------------
# Social & Misc PWAs
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.magkoliahgffibhgfkmoealggombgknl'
run = 'move-node-to-workspace X' # Discord
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.ohghonlafcimfigiajnmhdklcbjlbfda'
run = 'move-node-to-workspace X' # LinkedIn
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.hhmfhkhhhimecngbjafdnmaokhncedbb'
run = 'move-node-to-workspace X' #Slack
[[on-window-detected]]
if.app-id = 'com.brave.Browser.app.lodlkdfmihgonocnmddehnfgiljnadcf'
run = 'move-node-to-workspace X' #X Twitter
# ----------------------------------------------------------------------------
# Other
# ----------------------------------------------------------------------------
[[on-window-detected]]
if.app-id = 'edu.mit.scratch.scratch-desktop'
run = 'move-node-to-workspace S'
# ~/.zshrc - Cleaned and Fixed
# ===== ENVIRONMENT SETUP =====
eval "$(/opt/homebrew/bin/brew shellenv)"
export HOMEBREW_NO_INSECURE_REDIRECT=1
# ===== ZSH CONFIGURATION =====
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="arrow"
# Update automatically without asking
zstyle ':omz:update' mode auto
zstyle ':omz:update' frequency 13
COMPLETION_WAITING_DOTS="true"
if [[ "$TERM_PROGRAM" == "ghostty" ]]; then
export TERM=xterm-256color
fi
# Plugins - MUST be before sourcing oh-my-zsh
plugins=(
git
z
tldr
zsh-autosuggestions
zsh-syntax-highlighting
ssh-agent
brew
docker
tmux
fzf
pyenv
)
source "$ZSH/oh-my-zsh.sh"
# ===== HISTORY CONFIGURATION =====
export HISTFILE=~/.zsh_history
export HISTSIZE=100000
export SAVEHIST=100000
# History options
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_SPACE
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
# ===== COMPLETION SETUP =====
autoload -U compinit; compinit
zstyle ':completion:*' menu select
fpath+=~/.zfunc
# ===== PATH CONFIGURATION =====
# Go
#export GOROOT=/usr/local/go
#export GOPATH=$HOME/go
#export PATH="$GOPATH/bin:$GOROOT/bin:$PATH"
export GOROOT="$(brew --prefix go)/libexec"
export PATH="$GOROOT/bin:$PATH"
# Java
export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
export PATH="$JAVA_HOME/bin:$PATH"
# Node.js
export PATH="/opt/homebrew/opt/node@18/bin:$PATH"
# Android
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
# Local bins
export PATH="$HOME/.yarn/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
# ===== EXTERNAL DATA DIRECTORIES =====
export OLLAMA_MODELS=/Volumes/lcldata/ollama-models
export OLLAMA_HOST="0.0.0.0"
export OLLAMA_FLASH_ATTENTION=1
export OLLAMA_KV_CACHE_TYPE="q8_0"
export LMSTUDIO_MODELS_PATH=/Volumes/lcldata/ollama-models
export VLLM_TARGET_DEVICE=empty
export HF_HOME="/Volumes/lcldata/hf-models"
export HUGGINGFACE_HUB_CACHE="/Volumes/lcldata/hf-models/huggingface_cache"
export MISE_DATA_DIR="/Volumes/lcldata/mise"
export MISE_STATE_DIR="/Volumes/lcldata/mise/misestate"
# TOKENS/KEYS
export GITHUB_TOKEN=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
export HF_TOKEN=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
export SOPS_PGP_FP=191AF65F1C81E1A40535B3F8B8D6963A11F5FB00
# ===== TOOL INITIALIZATION =====
eval "$(mise activate)"
eval "$(starship init zsh)"
# OrbStack
source ~/.orbstack/shell/init.zsh 2>/dev/null || :
# ===== FZF CONFIGURATION =====
export FZF_BASE="$ZSH/plugins/fzf"
# Use fd if available, otherwise fallback to find
if command -v fd &> /dev/null; then
export FZF_DEFAULT_COMMAND='fd --hidden --strip-cwd-prefix --exclude .git'
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
else
export FZF_DEFAULT_COMMAND='find . -type f ! -path "*/\.git/*" | sed "s|^\./||"'
export FZF_ALT_C_COMMAND='find . -type d ! -path "*/\.git/*" | sed "s|^\./||"'
fi
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# FZF preview options
if command -v bat &> /dev/null; then
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'"
else
export FZF_CTRL_T_OPTS="--preview 'head -200 {}'"
fi
if command -v eza &> /dev/null; then
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
else
export FZF_ALT_C_OPTS="--preview 'ls -la {}'"
fi
# FZF completion function
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd)
if command -v eza &> /dev/null; then
fzf --preview 'eza --tree --color=always {} | head -200' "$@"
else
fzf --preview 'ls -la {}' "$@"
fi
;;
export|unset)
fzf --preview "eval 'echo \${}'" "$@"
;;
ssh)
fzf --preview 'dig {}' "$@"
;;
*)
fzf "$@"
;;
esac
}
# FZF Git integration
if [[ -f ~/src/fzf-git.sh/fzf-git.sh ]]; then
source ~/src/fzf-git.sh/fzf-git.sh
fi
# ===== COMPILER FLAGS =====
export LDFLAGS="-L/opt/homebrew/opt/openssl@3.5/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3.5/include"
export PKG_CONFIG_PATH=/opt/homebrew/Cellar/icu4c@77/77.1/lib/pkgconfig/
# ===== EDITOR =====
export EDITOR='vim'
# ===== ALIASES =====
# Configuration editing
alias zshconfig="vim ~/.zshrc"
alias ohmyzsh="vim ~/.oh-my-zsh"
alias sshconfig="vim ~/.ssh/config"
alias kittyconfig="vim ~/.config/kitty/kitty.conf"
# Python virtual environments
alias av="source .venv/bin/activate"
alias dv="deactivate"
# Enhanced ls - simplified
if command -v eza &> /dev/null; then
alias ls="eza --color=auto --long --git --no-filesize --icons=always"
alias ll="eza --color=auto --long --git --no-filesize --icons=always"
else
alias ll='ls -la'
fi
# Meld integration
alias meld='meld_script(){ /Applications/Meld.app/Contents/MacOS/Meld "$@" 2>/dev/null & };meld_script'
# YouTube transcript extraction - simplified
alias pt="yt-dlp --skip-download --write-auto-subs --sub-lang en --convert-subs srt"
# ===== PRODUCTIVITY ALIASES =====
# Quick navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ~='cd ~'
alias -- -='cd -'
# Git shortcuts
alias g='git'
alias ga='git add'
alias gaa='git add .'
alias gc='git commit -m'
alias gp='git push'
alias gl='git pull'
alias gs='git status'
alias gd='git diff'
alias gb='git branch'
alias gco='git checkout'
alias gcb='git checkout -b'
alias glog='git log --oneline --graph --decorate'
# Docker shortcuts
alias d='docker'
alias dc='docker-compose'
alias dps='docker ps'
alias dpsa='docker ps -a'
alias di='docker images'
alias drm='docker rm'
alias drmi='docker rmi'
alias dstop='docker stop $(docker ps -q)'
alias dclean='docker system prune -af'
# System shortcuts
alias reload='source ~/.zshrc'
alias path='echo $PATH | tr ":" "\n"'
alias myip='curl -s ifconfig.me'
alias localip='ipconfig getifaddr en0'
alias weather='curl wttr.in'
alias ports='lsof -i -P -n | grep LISTEN'
alias df='df -h'
alias du='du -h'
alias free='vm_stat'
# Modern replacements (if tools are installed)
if command -v bat &> /dev/null; then
alias cat='bat'
alias less='bat'
fi
if command -v delta &> /dev/null; then
export GIT_PAGER='delta'
fi
# ===== USEFUL FUNCTIONS =====
# Create directory and cd into it
mkcd() {
mkdir -p "$1" && cd "$1"
}
# Extract various archive formats
extract() {
if [ -f "$1" ]; then
case "$1" in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar e "$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
}
# Find and kill process by name
killp() {
if [ -z "$1" ]; then
echo "Usage: killp <process_name>"
return 1
fi
ps aux | grep -i "$1" | grep -v grep | awk '{print $2}' | xargs kill -9
}
# Quick file search
ff() {
if command -v fd &> /dev/null; then
fd "$1"
else
find . -name "*$1*" 2>/dev/null
fi
}
# Search in files
search() {
if command -v rg &> /dev/null; then
rg -i "$1"
else
grep -r -i "$1" .
fi
}
# Show largest directories
largest() {
du -sh */ | sort -hr | head -10
}
# Create a backup of a file
backup() {
cp "$1" "$1.backup.$(date +%Y%m%d_%H%M%S)"
}
# Quick HTTP server
serve() {
local port=${1:-8000}
python3 -m http.server "$port"
}
# Generate random password
genpass() {
local length=${1:-16}
openssl rand -base64 $length | head -c $length; echo
}
# ===== ENHANCED FZF SHORTCUTS =====
# Search and edit files with fzf + vim
fe() {
local files
if command -v fd &> /dev/null; then
files=$(fd --type f --hidden --follow --exclude .git | fzf --multi --preview 'bat --color=always {}')
else
files=$(find . -type f | fzf --multi --preview 'head -100 {}')
fi
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
}
# cd to directory with fzf
fcd() {
local dir
if command -v fd &> /dev/null; then
dir=$(fd --type d --hidden --follow --exclude .git | fzf --preview 'ls -la {}')
else
dir=$(find . -type d | fzf --preview 'ls -la {}')
fi
[[ -n "$dir" ]] && cd "$dir"
}
# Kill process with fzf
fkill() {
local pid
pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
[[ -n "$pid" ]] && kill -9 "$pid"
}
# Git branch switching with fzf
fgb() {
local branch
branch=$(git branch --all | grep -v HEAD | sed "s/.* //" | sed "s#remotes/[^/]*/##" | sort -u | fzf)
[[ -n "$branch" ]] && git checkout "$branch"
}
# ===== PRODUCTIVITY KEYBINDINGS =====
# Ctrl+O to open file with fzf
bindkey -s '^O' 'fe\n'
# Ctrl+G to cd with fzf
bindkey -s '^G' 'fcd\n'
# Alt+C to copy current directory to clipboard
copy_pwd() {
pwd | pbcopy
echo "$(pwd) copied to clipboard"
}
zle -N copy_pwd
bindkey '^[c' copy_pwd
# ===== ENVIRONMENT IMPROVEMENTS =====
# Better less options
export LESS='-R -i -w -M -z-4'
# Colorful man pages
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# Node.js performance
export NODE_OPTIONS="--max-old-space-size=4096"
# Python improvements
export PYTHONDONTWRITEBYTECODE=1
export PYTHONUNBUFFERED=1
# ===== AUTO-SUGGESTIONS IMPROVEMENTS =====
# ZSH autosuggestions configuration
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#666666"
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
# ===== SYNTAX HIGHLIGHTING =====
# Enhanced syntax highlighting
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red')
# ===== TMUX INTEGRATION =====
# Auto-start tmux
if command -v tmux &> /dev/null && [[ -z "$TMUX" ]] && [[ $- == *i* ]]; then
# Uncomment the next line if you want tmux to auto-start
# tmux attach-session -t default || tmux new-session -s default
fi
# Added by LM Studio CLI (lms)
export PATH="$PATH:/Users/vinayak/.lmstudio/bin"
# End of LM Studio CLI section
export GEMINI_API_KEY="AIzaSyDm_aemri16hKSjwxFgUqLXyuVLDI5zIoA"
yt() {
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then
echo "Usage: yt [-t | --timestamps] youtube-link"
echo "Use the '-t' flag to get the transcript with timestamps."
return 1
fi
transcript_flag="--transcript"
if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then
transcript_flag="--transcript-with-timestamps"
shift
fi
local video_link="$1"
fabric-ai -y "$video_link" $transcript_flag --yt-dlp-args='--cookies-from-browser brave'
}
if [ -n "$ITERM2_BADGE" ]; then
printf "\e]1337;SetBadgeFormat=%s\a" $(echo -n "$ITERM2_BADGE" | base64)
fi

Here's your complete reference summary based on your final configuration:


Keychron K6 Karabiner Configuration Summary

Device Identification

Your K6 is configured with two device identifiers:

Device Vendor ID Product ID
K6 (Complex Mods) 1452 591
K6 (Simple Mods) 13364 4451

Note: The K6 may appear as different devices depending on Bluetooth vs Wired mode


Simple Modifications (Device-Specific)

Applied only to your K6, not to MacBook's internal keyboard:

From Key To Key Purpose
caps_lock escape Caps Lock becomes your new ESC key
escape grave_accent_and_tilde Physical ESC types backtick `
grave_accent_and_tilde escape Top-left key (if exists) becomes ESC
home delete_forward Home key acts as Forward Delete
page_up home Page Up becomes Home
page_down end Page Down becomes End

Complex Modifications (ESC + Modifier Combos)

These give you quick access to backtick, tilde, and window switching:

Shortcut Output Use Case
Shift + ESC ` (backtick) Markdown code, terminal commands
Ctrl + ESC ~ (tilde) Home directory, paths
Cmd + ESC Cmd + ~ Switch windows within same app

Final Key Behavior on Your K6

Physical Key Tap With Shift With Ctrl With Cmd
ESC ` ` ~ Cmd + ~
Caps Lock Escape
Home Forward Delete
Page Up Home
Page Down End

K6 Hardware Shortcuts to Remember

These are built into the keyboard firmware (not Karabiner):

Bluetooth

Combo Function
fn1 + Q Switch to Bluetooth device 1
fn1 + W Switch to Bluetooth device 2
fn1 + E Switch to Bluetooth device 3
fn1 + Q/W/E (hold 4s) Pair new device to slot 1/2/3

Media & Volume

Combo Function
fn1 + - Volume down
fn1 + = Volume up
fn1 + [ Previous track
fn1 + ] Next track
fn1 + \ Play/Pause

Function Keys

Combo Function
fn1 + 1 through 0 F1 – F10
fn1 + - F11
fn1 + = F12

Backlight

Combo Function
Light key Cycle RGB effects
fn1 + Light key Toggle backlight on/off
fn1 + ← Decrease brightness
fn1 + → Increase brightness
fn1 + L + Light key (4s) Lock/unlock light effect

System

Combo Function
fn1 + S + O (4s) Disable auto-sleep mode
fn1 + J + Z (4s) Factory reset
fn1 + K + R (4s) Switch function key layout

Backup Instructions

File Location

~/.config/karabiner/karabiner.json

Quick Backup Command

cp ~/.config/karabiner/karabiner.json ~/Desktop/karabiner-backup-$(date +%Y%m%d).json

Restore Command

cp ~/Desktop/karabiner-backup-YYYYMMDD.json ~/.config/karabiner/karabiner.json

Things to Remember

  1. Caps Lock is now ESC — use it for Vim, closing dialogs, etc.

  2. Physical ESC types backtick — no need for fn1+ESC anymore

  3. Ctrl+ESC for tilde — quick access to ~ for terminal paths

  4. Cmd+ESC for window switching — replaces the standard Cmd + ~

  5. Page Up/Down remapped — now act as Home/End for line navigation

  6. Home is Forward Delete — useful for deleting text ahead of cursor

  7. Config is device-specific — MacBook keyboard is unaffected

  8. Menu bar icon hidden"show_in_menu_bar": false keeps it clean; access Karabiner via Spotlight

{
"global": { "show_in_menu_bar": false },
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "Shift + Esc to Tilde (~)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": { "mandatory": ["shift"] }
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": ["shift"]
}
]
}
]
},
{
"description": "Option + Esc to Backtick (`)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": { "mandatory": ["option"] }
},
"to": [
{ "key_code": "grave_accent_and_tilde" }
]
}
]
},
{
"description": "Command + Esc to Command + Tilde (Window Switcher)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": { "mandatory": ["command"] }
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": ["command"]
}
]
}
]
}
]
},
"devices": [
{
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 4451,
"vendor_id": 13364
},
"ignore": false,
"simple_modifications": [
{
"from": { "key_code": "home" },
"to": [{ "key_code": "delete_forward" }]
},
{
"from": { "key_code": "page_up" },
"to": [{ "key_code": "home" }]
},
{
"from": { "key_code": "page_down" },
"to": [{ "key_code": "end" }]
}
]
}
],
"name": "Default",
"selected": true,
"virtual_hid_keyboard": {
"country_code": 0,
"keyboard_type_v2": "ansi"
}
}
]
}
git:
pagers:
- colorArg: always
pager: delta --dark --paging=never --syntax-theme base16-256 -s
gui:
sidePanelWidth: 0.2
services:
# Traefik Reverse Proxy - http://traefik.localhost
traefik:
image: traefik:v3.3
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /Volumes/lcldata/docker-volumes/traefik:/etc/traefik/dynamic:ro
extra_hosts:
- "host.docker.internal:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.localhost`)"
- "traefik.http.routers.dashboard.entrypoints=web"
- "traefik.http.routers.dashboard.service=api@internal"
restart: unless-stopped
networks:
- web
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# LiteLLM - Unified LLM Gateway - http://litellm.localhost
litellm:
image: ghcr.io/berriai/litellm:main-stable
container_name: litellm
volumes:
- /Volumes/lcldata/docker-volumes/litellm:/app/litellm-config
environment:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:-sk-litellm-master-key}
- LITELLM_SALT_KEY=${LITELLM_SALT_KEY:-sk-litellm-salt-key}
# API Keys - loaded from .env
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
command:
- "--config"
- "/app/litellm-config/config.yaml"
- "--port"
- "4000"
extra_hosts:
- "host.docker.internal:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.routers.litellm.rule=Host(`litellm.localhost`)"
- "traefik.http.routers.litellm.entrypoints=web"
- "traefik.http.services.litellm.loadbalancer.server.port=4000"
restart: unless-stopped
networks:
- web
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# Open WebUI - http://gptall.localhost
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
volumes:
- ./data/open-webui:/Volumes/lcldata/docker-volumes/open-webui
environment:
- OLLAMA_BASE_URL=http://host.docker.internal:11434
- WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY:-changeme}
- WEBUI_NAME=GPT All
extra_hosts:
- "host.docker.internal:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.routers.openwebui.rule=Host(`gptall.localhost`)"
- "traefik.http.routers.openwebui.entrypoints=web"
- "traefik.http.services.openwebui.loadbalancer.server.port=8080"
restart: unless-stopped
networks:
- web
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# Stirling PDF - http://pdftool.localhost
stirling-pdf:
image: stirlingtools/stirling-pdf:latest
container_name: stirling-pdf
volumes:
- ./data/stirling-pdf/training-data:/Volumes/lcldata/docker-volumnes/Stirling-testdata
- ./data/stirling-pdf/configs:/Volumes/lcldata/docker-volumes/Stirling-testdata/configs
environment:
- DOCKER_ENABLE_SECURITY=false
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=en_GB
labels:
- "traefik.enable=true"
- "traefik.http.routers.stirlingpdf.rule=Host(`pdftool.localhost`)"
- "traefik.http.routers.stirlingpdf.entrypoints=web"
- "traefik.http.services.stirlingpdf.loadbalancer.server.port=8080"
restart: unless-stopped
networks:
- web
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
web:
driver: bridge
Host *
ServerAliveInterval 30
ServerAliveCountMax 5
Host github.com
HostName github.com
#AddKeysToAgent yes
User git
UseKeychain yes
IdentityFile ~/Documents/KEYS/id_vinayakg_rsa
Host gh
HostName github.com
#AddKeysToAgent yes
User git
UseKeychain yes
IdentityFile ~/Documents/KEYS/id_vinayakg_rsa
Host gh-pyt
HostName github.com
User git
UseKeychain yes
IdentityFile ~/Documents/KEYS/id_pyt_rsa
Host bitbucket.org
HostName bitbucket.org
User git
UseKeychain yes
IdentityFile ~/Documents/KEYS/git_eduvanz_rsa
Host prod-bastion
Hostname 13.235.174.10
User ubuntu
IdentityFile ~/Documents/KEYS/prod-eduvanz-keypair.pem
Host staging-bastion
Hostname 13.234.245.80
User ubuntu
IdentityFile ~/Documents/KEYS/dev-eduvanz-key.pem
Host new-bastion
Hostname 65.0.182.241
User ubuntu
IdentityFile ~/Documents/KEYS/bastion_rsa_prod
Host nat-edu
Hostname 15.206.161.17
User ec2-user
IdentityFile ~/Documents/KEYS/Prod-Eduvanz-NAT-Key.pem
Host phabricator
Hostname 52.66.192.2
User ubuntu
IdentityFile ~/Documents/KEYS/eduvanz-lightsail-phabricator.pem
Host edu-1
Hostname 10.10.2.205
User ubuntu
IdentityFile ~/Documents/KEYS/Prod-Eduvanz-Application-KeyPair.pem
Host edu-2
Hostname 10.10.3.235
User ubuntu
IdentityFile ~/Documents/KEYS/Prod-Eduvanz-Application-KeyPair.pem
#!/bin/bash
tmux kill-session -t work 2>/dev/null
tmux new-session -d -s work
tmux split-window -v -t work
tmux split-window -h -t work:1.1
tmux split-window -h -t work:1.3
sleep 0.5
tmux send-keys -t work:1.1 ' fastfetch' Enter
tmux send-keys -t work:1.2 ' while true; do ssh cdoh; sleep 60; done' Enter
tmux send-keys -t work:1.3 ' while true; do ssh oci-dev; sleep 60; done' Enter
tmux send-keys -t work:1.4 ' while true; do ssh cd-data-proc; sleep 60; done' Enter
tmux select-pane -t work:1.1 -T "fastfetch"
tmux select-pane -t work:1.2 -T "cdoh"
tmux select-pane -t work:1.3 -T "oci-dev"
tmux select-pane -t work:1.4 -T "data-proc"
tmux attach -t work
# Prefix
set -g prefix C-Space
set -g prefix2 C-b
bind C-Space send-prefix
# Reload config
bind q source-file ~/.config/tmux/tmux.conf
# Vi mode for copy
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
# Pane Controls
bind h split-window -h -c "#{pane_current_path}"
bind v split-window -v -c "#{pane_current_path}"
bind x kill-pane
bind -n C-M-Left select-pane -L
bind -n C-M-Right select-pane -R
bind -n C-M-Up select-pane -U
bind -n C-M-Down select-pane -D
bind -n C-M-S-Left resize-pane -L 5
bind -n C-M-S-Down resize-pane -D 5
bind -n C-M-S-Up resize-pane -U 5
bind -n C-M-S-Right resize-pane -R 5
# Window navigation
bind r command-prompt -I "#W" "rename-window -- '%%'"
bind c new-window -c "#{pane_current_path}"
bind k kill-window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# Session controls
bind R command-prompt -I "#S" "rename-session -- '%%'"
bind C new-session -c "#{pane_current_path}"
bind K kill-session
bind P switch-client -p
bind N switch-client -n
# General
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",*:RGB"
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g history-limit 50000
set -g escape-time 0
set -g focus-events on
set -g set-clipboard on
set -g allow-passthrough on
setw -g aggressive-resize on
set -g detach-on-destroy off
# Status bar
set -g status-position top
set -g status-interval 5
set -g status-left-length 30
set -g status-right-length 50
set -g window-status-separator ""
# Theme
set -g status-style "bg=default,fg=default"
set -g status-left "#[fg=white,bg=blue,bold] #S #[bg=default] "
set -g status-right "#[fg=blue]#{?client_prefix,PREFIX ,}#[fg=cyan,bold]#h "
set -g window-status-format "#[fg=brightblack] #I:#W "
set -g window-status-current-format "#[fg=blue,bold] #I:#W "
set -g pane-border-style "fg=brightblack"
set -g pane-active-border-style "fg=blue"
set -g message-style "bg=default,fg=blue"
set -g message-command-style "bg=default,fg=blue"
set -g mode-style "bg=blue,fg=black"
setw -g clock-mode-colour blue
http:
routers:
llm-council:
rule: "Host(`llm-council.localhost`)"
entryPoints:
- web
service: llm-council-service
llm-council-api:
#rule: "Host(`llm-council.localhost`) && PathPrefix(`/api`)"
rule: "Host(`llm-council-api.localhost`)"
entryPoints:
- web
service: llm-council-api-service
services:
llm-council-service:
loadBalancer:
servers:
- url: "http://host.docker.internal:5173"
llm-council-api-service:
loadBalancer:
servers:
- url: "http://host.docker.internal:8001"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment