feat: migrate from Zsh to Fish shell with comprehensive configuration

Major shell migration replacing Zsh/Oh-My-Zsh with Fish shell:

- Remove all Zsh configurations (dot_zshrc.tmpl, dot_p10k.zsh)
- Remove Oh-My-Zsh external dependencies from .chezmoiexternal.toml
- Add complete Fish shell setup with config.fish.tmpl and abbr.fish.tmpl
- Implement Fish-native functions for lazy-loading tools (mise, pyenv, zoxide, etc.)
- Create commonrc.fish.tmpl for cross-shell compatibility
- Add Fish plugin management via Fisher (tide prompt, fzf.fish)
- Update documentation (CLAUDE.md, TODO.md, ONBOARDING.md) to reflect Fish
- Add .fish.tmpl file association to VS Code settings
- Enhance PowerShell profile with lsd aliases
- Configure git delta pager and zdiff3 merge conflict style
- Update WSL keychain integration for Fish shell

This migration maintains all existing tool integrations while improving
startup performance through lazy-loading and Fish's native features.
This commit is contained in:
2025-10-27 13:37:00 -05:00
parent 4095b2d242
commit 4d914f1e2f
34 changed files with 501 additions and 1864 deletions

View File

@@ -0,0 +1,89 @@
# Fish shell common configuration
# This template provides environment setup for Fish shell
# General configuration
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
# Authentication
set -gx OPENAI_API_KEY "{{ dopplerProjectJson.OPENAI_CHATGPT_CLI }}"
# hishtory (lazy-loaded via __init_hishtory function)
test -d $HOME/.hishtory && fish_add_path $HOME/.hishtory
# PATH setup
test -d $HOME/bin && fish_add_path $HOME/bin
fish_add_path /usr/local/bin
fish_add_path $HOME/.local/bin
test -d /usr/local/go/bin && fish_add_path /usr/local/go/bin # Go
test -d $HOME/go/bin && fish_add_path $HOME/go/bin # Go-installed tools
test -d $HOME/.local/share/bob/nvim-bin && fish_add_path $HOME/.local/share/bob/nvim-bin # Bob, Neovim package manager
# Deno
if test -d $HOME/.deno
source $HOME/.deno/env.fish 2>/dev/null || set -gx DENO_INSTALL $HOME/.deno && fish_add_path $DENO_INSTALL/bin
end
# Rust (Cargo)
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
fish_add_path $CARGO_HOME/bin
end
# Homebrew
if test -f /home/linuxbrew/.linuxbrew/bin/brew
eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv)
end
set -gx PYENV_ROOT $HOME/.pyenv
# bun
set -gx BUN_INSTALL $HOME/.bun
fish_add_path $BUN_INSTALL/bin
# Note: Bun's _bun file is bash-specific, Fish completions handled separately
# jenv (Java version manager)
if test -d $HOME/.jenv/bin
fish_add_path $HOME/.jenv/bin
if command -q jenv
jenv init - fish | source
end
end
# pnpm
set -gx PNPM_HOME $HOME/.local/share/pnpm
if not contains $PNPM_HOME $PATH
fish_add_path $PNPM_HOME
end
# spicetify
if test -d $HOME/.spicetify
fish_add_path $HOME/.spicetify
end
# pulumi
if test -d $HOME/.pulumi/bin
fish_add_path $HOME/.pulumi/bin
end
# dotnet
if test -d $HOME/.dotnet
set -gx DOTNET_ROOT $HOME/.dotnet
fish_add_path $DOTNET_ROOT
fish_add_path $DOTNET_ROOT/tools
end
# Note: Aliases are defined in Fish-native format in ~/.config/fish/conf.d/abbr.fish
# The bash_aliases file contains bash-specific syntax and is not sourced here
{{- /* WSL-specific settings */ -}}
{{- if .data.wsl }}
## Ensures CLI apps open URLs in the default Windows browser
set -gx BROWSER 'powershell.exe /c start'
{{- end }}

View File

@@ -1,4 +1,4 @@
# This template's argument is the shell as a string (bash, zsh).
# This template's argument is the shell as a string (bash, ...).
# general configuration
export EDITOR="micro"
@@ -13,9 +13,7 @@ export OPENAI_API_KEY="{{ dopplerProjectJson.OPENAI_CHATGPT_CLI }}"
# hishtory
export HISHTORY_SERVER="https://hsh.{{ dopplerProjectJson.PRIVATE_DOMAIN }}"
export PATH="$PATH:$HOME/.hishtory"
{{ if eq .shell "zsh" -}}
source $HOME/.hishtory/config.zsh
{{ else if eq .shell "bash" -}}
{{ if eq .shell "bash" -}}
source $HOME/.hishtory/config.sh
{{- else -}}
{{ fail "Unexpected shell." }}
@@ -63,19 +61,6 @@ if [ -d $HOME/.jenv/bin ]; then
fi
fi
if command -v hass-cli &> /dev/null; then
export HASS_SERVER={{ dopplerProjectJson.HASS_SERVER_URL }}
export HASS_TOKEN={{ dopplerProjectJson.HASS_SERVER_TOKEN }}
{{ if eq .shell "bash" -}}
source <(_HASS_CLI_COMPLETE=bash_source hass-cli)
{{ else if eq .shell "zsh" -}}
source <(_HASS_CLI_COMPLETE=zsh_source hass-cli)
{{ else if eq .shell "fish" -}}
eval (_HASS_CLI_COMPLETE=fish_source hass-cli)
{{ end }}
fi
# pnpm
export PNPM_HOME="$HOME/.local/share/pnpm"
case ":$PATH:" in
@@ -93,7 +78,6 @@ if [ -d "$HOME/.pulumi/bin" ]; then
export PATH=$PATH:$HOME/.pulumi/bin
fi
# load aliases (note: omz aliases are supposed to be placed in ZSH_CUSTOM?)
. $HOME/.bash_aliases
@@ -108,14 +92,4 @@ export BROWSER='powershell.exe /c start'
if [ -d "$HOME/.dotnet" ]; then
export DOTNET_ROOT="$HOME/.dotnet"
export PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools"
fi
# disable screen blanking
# source $(brew --prefix)/share/zsh/site-functions/_todoist_peco
# xset s off && xset -dpms
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='micro'
# else
# export EDITOR='nvim'
# fi
fi