# Common shell configuration for Fish # This template provides environment setup for Fish shell # # Load order: ~/.config/fish/config.fish → commonrc.fish.tmpl → conf.d/*.fish # Bash equivalent: ~/.bashrc → commonrc.sh.tmpl → ~/.bash_aliases set -gx EDITOR "micro" set -gx GPG_TTY (tty) set -gx MICRO_TRUECOLOR 1 set -gx TERM xterm-256color # fixes terminal colors when ssh'ing into laptop set -gx OPENAI_API_KEY "{{ dopplerProjectJson.OPENAI_CHATGPT_CLI }}" # R2 configuration set -gx R2_ENDPOINT "{{ dopplerProjectJson.R2_ENDPOINT }}" set -gx R2_ACCESS_KEY_ID "{{ dopplerProjectJson.R2_ACCESS_KEY_ID }}" set -gx R2_SECRET_ACCESS_KEY "{{ dopplerProjectJson.R2_SECRET_ACCESS_KEY }}" set -gx R2_BUCKET "{{ dopplerProjectJson.R2_BUCKET }}" # Tools are organized in priority order (first = highest priority in PATH) # This order matches the Bash config for consistency # Batched for performance - reduces startup time by ~13ms set -l paths_to_add # Collect paths with conditional checks test -d $HOME/.hishtory && set -a paths_to_add $HOME/.hishtory test -d $HOME/bin && set -a paths_to_add $HOME/bin set -a paths_to_add /usr/local/bin $HOME/.local/bin test -d $HOME/.local/share/bob/nvim-bin && set -a paths_to_add $HOME/.local/share/bob/nvim-bin # Bob, Neovim package manager # Deno (conditionally source env file or add to path list) if test -d $HOME/.deno if not source $HOME/.deno/env.fish 2>/dev/null set -gx DENO_INSTALL $HOME/.deno set -a paths_to_add $DENO_INSTALL/bin end end # Rust/Cargo (source env file or add to path list) if test -f $HOME/.cargo/env.fish source $HOME/.cargo/env.fish else if test -f $HOME/.cargo/env # Fallback: parse bash env file set -gx CARGO_HOME $HOME/.cargo set -a paths_to_add $CARGO_HOME/bin end # Homebrew (cached for performance - reduces startup time by ~14ms) if test -f /home/linuxbrew/.linuxbrew/bin/brew set -l brew_cache "$HOME/.cache/brew_env.fish" set -l brew_bin "/home/linuxbrew/.linuxbrew/bin/brew" # Regenerate cache if: doesn't exist, >7 days old, or brew binary is newer if not test -f "$brew_cache"; \ or test (math (date +%s) - (stat -c %Y "$brew_cache" 2>/dev/null || echo 0)) -gt 604800; \ or test (stat -c %Y "$brew_bin" 2>/dev/null || echo 0) -gt (stat -c %Y "$brew_cache" 2>/dev/null || echo 0) mkdir -p (dirname "$brew_cache") $brew_bin shellenv > "$brew_cache" 2>/dev/null end test -f "$brew_cache" && source "$brew_cache" end set -gx PYENV_ROOT $HOME/.pyenv # bun set -gx BUN_INSTALL $HOME/.bun set -a paths_to_add $BUN_INSTALL/bin # Note: Bun's _bun file is bash-specific, Fish completions handled separately # jenv (add to path list for later batch add) if test -d $HOME/.jenv/bin set -a paths_to_add $HOME/.jenv/bin end # pnpm set -gx PNPM_HOME $HOME/.local/share/pnpm set -a paths_to_add $PNPM_HOME # spicetify test -d $HOME/.spicetify && set -a paths_to_add $HOME/.spicetify # opencode test -d $HOME/.opencode/bin && set -a paths_to_add $HOME/.opencode/bin # pulumi test -d $HOME/.pulumi/bin && set -a paths_to_add $HOME/.pulumi/bin # humanlog test -d $HOME/.humanlog/bin && set -a paths_to_add $HOME/.humanlog/bin # dotnet if test -d $HOME/.dotnet set -gx DOTNET_ROOT $HOME/.dotnet set -a paths_to_add $DOTNET_ROOT $DOTNET_ROOT/tools end # CUDA if test -d /usr/local/cuda-11.8 set -a paths_to_add /usr/local/cuda-11.8/bin test -d /usr/local/cuda-11.8/lib64 && set -gx LD_LIBRARY_PATH /usr/local/cuda-11.8/lib64 $LD_LIBRARY_PATH end # Batch add all collected paths (single PATH reconstruction instead of 17+ calls) test -n "$paths_to_add[1]" && fish_add_path $paths_to_add # foundry (appended to PATH - lower priority) if test -d $HOME/.foundry/bin set -gx PATH $PATH $HOME/.foundry/bin end # Note: Fish uses mise (via conf.d/mise.fish) for unified version management. # Bash uses mise as well, falling back to legacy managers if needed. # Post-PATH initialization for tools that need commands available if test -d $HOME/.jenv/bin; and command -q jenv jenv init - fish | source end # Note: Fish aliases are defined in ~/.config/fish/conf.d/abbr.fish # Bash aliases are in ~/.bash_aliases (bash-specific syntax) {{- if .data.wsl }} # Windows browser integration (open URLs in Windows browser, not CLI browser) set -gx BROWSER 'powershell.exe /c start' # Cursor IDE CLI (Windows installation accessible from WSL) test -x /mnt/c/Users/Xevion/AppData/Local/Programs/cursor/resources/app/bin/cursor && \ fish_add_path /mnt/c/Users/Xevion/AppData/Local/Programs/cursor/resources/app/bin # Zed Editor CLI (Windows installation accessible from WSL) test -x /mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin/zed && \ fish_add_path /mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin # Windows Terminal helper function (launch WT in current directory) function wt if test (count $argv) -eq 0 wt.exe -w 0 sp wsl --cd (pwd) else wt.exe -w 0 $argv wsl --cd (pwd) end end {{- end }} # atuin (magical shell history with sync) if command -q atuin atuin init fish --disable-up-arrow | source end