This document describes the configuration of the Fish shell environment.
- XDG Base Directories
- Path Configuration
- Theme and Appearance
- Cache Management
- Plugin Management
- Shell Integration
- Development Tools
- File Management
- Key Bindings
- Environment Variables
- Abbreviations and Aliases
- Custom Functions
- Secrets Management
The configuration follows the XDG Base Directory Specification for organizing configuration files:
XDG_CONFIG_HOME:$HOME/.configXDG_DATA_HOME:$HOME/.local/shareXDG_STATE_HOME:$HOME/.local/stateXDG_CACHE_HOME:$HOME/.cache
These directories are automatically created if they don't exist.
The configuration automatically adds all subdirectories for functions and completions:
- For functions: all subfolders inside
$__fish_config_dir/functions/are added tofish_function_path. - For completions: all subfolders inside
$__fish_config_dir/completions/are added tofish_complete_path.
The implementation and configuration of this logic is located in conf.d/recursive_paths.fish.
The shell uses Catppuccin theme with automatic dark/light mode detection based on macOS system settings:
- Dark mode: Catppuccin Macchiato
- Light mode: Catppuccin Latte
The configuration supports dynamic theme switching for all components, including:
- fzf - interactive file search
- bat - syntax highlighting
- eza (ls) - file listing color scheme
- Fish shell - shell theme
# Reload all themes (fish, fzf, bat, eza)
theme_reload # or shortcut: tr
# Reload only fzf theme
fzf_theme_reload # or shortcut: ftrFish 4.3+ supports automatic theme change detection through the built-in fish_terminal_color_theme variable. When you change the theme in macOS, modern terminals (Ghostty, iTerm2, WezTerm) automatically notify Fish of the change.
Automatic theme reloading is enabled by default through the reload_theme function, which subscribes to fish_terminal_color_theme changes:
# Automatically triggered when terminal theme changes
function reload_theme --on-variable fish_terminal_color_theme
# Theme switching logic
endHow it works:
- You change the theme in macOS settings (light ↔ dark)
- Terminal sends Fish an OSC sequence about the theme change
- Fish updates the
fish_terminal_color_themevariable - The
reload_themefunction automatically triggers - All themes (fzf, bat, eza, fish) update instantly across all open sessions
Note: If your terminal doesn't support OSC notifications, use the theme_reload command manually after changing the theme.
Cache files are managed in $XDG_CACHE_HOME/fish:
- Expired cache files (older than 1200 minutes) are automatically removed
- Cache initialization for various tools (Homebrew, FZF, Zoxide, mise, etc.)
- Cached configurations for better performance
Plugins are installed automatically using chezmoi based on the .chezmoiexternals/fish.toml file. This file contains all plugins, their sources, and update settings.
- catppuccin/fzf — Catppuccin theme for FZF
- PatrickF1/fzf.fish — FZF integration for Fish
- wfxr/forgit — Git workflow enhancements
See .chezmoiexternals/fish.toml for the full list and configuration.
- Custom prompt configuration from
$XDG_CONFIG_HOME/oh-my-posh/config.json - Automatic theme switching based on system appearance
- Version-based caching for performance
- Custom color schemes for dark/light modes using Catppuccin themes
- Default commands and preview settings with
fd - Integration with
batfor file preview - Custom key bindings for navigation and file editing
- Integration with
diff-so-fancyfor diff highlighting
Here is how FZF looks with the current Catppuccin theme settings:
| Light theme | Dark theme |
|---|---|
![]() |
![]() |
- Directory jumping functionality
- Automatic initialization with caching
- Template management integration
- Automatic completion generation
- ASDF: Configuration for multiple language versions
- Automatic shims setup
- Completion generation
- Config file location:
$HOME/.config/asdf/asdfrc
- MISE: Modern development environment management
- Automatic activation
- Completion generation
- Install path:
/opt/homebrew/bin/mise
- Automatic shell environment setup with caching
- Fish completions integration
- Analytics disabled by default (
HOMEBREW_NO_ANALYTICS=1)
- SDK home:
$HOME/stv-tools/webos-sdk - CLI tools path:
$LG_WEBOS_TV_SDK_HOME/bin - Tizen Studio integration
- Custom color schemes using Vivid with Catppuccin themes
- Various aliases for different listing options:
l: Basic listing with git ignorell: Detailed listing with headersllm: Modified time sortingla: All files with detailslt: Tree view
- Used as a replacement for
cat - Theme matching system appearance
- Syntax highlighting for various file types
- Vi mode enabled with custom bindings
- Clipboard integration for copy/paste operations
- Visual mode support
- Custom bindings:
Ctrl+L/Ctrl+Д: Clear screen and reinitializeCtrl+E/Ctrl+У: Open Neovimyin visual mode: Copy to clipboardyyin normal mode: Copy line to clipboardp: Paste from clipboard
The configuration sets XDG-compliant environment variables for Node.js and npm:
NODE_REPL_HISTORY: Stores Node.js REPL history in$XDG_STATE_HOME/node_repl_history.NPM_CONFIG_INIT_MODULE: Path to npm init script at$XDG_CONFIG_HOME/npm/config/npm-init.js.NPM_CONFIG_CACHE: Stores npm cache in$XDG_CACHE_HOME/npm.NPM_CONFIG_USERCONFIG: User npm config at$XDG_CONFIG_HOME/npm/npmrc.
This keeps Node.js and npm files organized and portable, following XDG standards.
EDITOR: NeovimVISUAL: Same as EDITORGIT_EDITOR: Same as EDITOR
GOPATH:$HOME/Library/goLG_WEBOS_TV_SDK_HOME: WebOS TV SDK locationBAT_THEME: Matches system themeSHELL: Fish shell path
$HOME/bin,$HOME/.bin,$HOME/.local/bin$HOME/.cargo/bin(Rust)$GOPATH/bin(Go)$WEBOS_CLI_TV(WebOS tools)node_modules/.bin(Node.js)- Coreutils GNU binaries
e: Open Neovimy: Open Yazi file managerca: Apply Chezmoi changesee: Neovim config pickereu: Update Neovim pluginsf: Fish performance testq: Exit shell
gb: List branchesgba: List all branchesgbsup: Set upstream branchgc!: Amend commitgcn!: Amend commit without editinggf: Fetchgfa: Fetch all and prunegl: Pullgp: Pushgpsup: Push and set upstreamgp!: Force push with leasegco: Checkoutgcod: Checkout developgcom: Checkout main
gfb,gff,gfr,gfh,gfs: Git flow commandsgfbs,gffs,gfrs,gfhs,gfss: Start flow branchesgfbt,gfft,gfrt,gfht,gfst: Track flow branches
The configuration includes several custom functions organized in the functions directory:
Neovim Related Functions
nvim_config_pick: Interactive function to select and switch between different Neovim configurationsnvim_update: Updates Neovim and its pluginsnvim_disable_builtin_colorschemes: Disables built-in color schemes in Neovim
Located in functions/core/git/:
git.branch_current: Helper function to get the current Git branch namegit.branch_prune: Git branch deletion utility for managing merged branches (including squashed commits)
Located in functions/core/yabai/:
yabai.rearrange: Rearranges windows when new ones are created (triggered by Yabai signal)yabai.restart: Restarts Yabai service cleanlyyabai.sudoers: Manages sudoers configuration for Yabai scripting addition
Located in functions/core/:
restart_vm: Utility for restarting window manager services (Yabai, skhd, SketchyBar, etc.)clear_and_reinit: Clears screen and reinitializes fish
Located in functions/wrappers/:
lazygit: Wrapper for the lazygit terminal UI for Gitbtm: Wrapper for the bottom (btm) system monitorgrep: Enhanced grep wrapper
These functions enhance the shell's functionality and provide convenient shortcuts for common tasks. They are automatically loaded when the shell starts.
The configuration integrates with KeePassXC for secure secret management:
OPENAI_API_KEY: OpenAI API keyGITLAB_TOKEN: GitLab access tokenGITHUB_TOKEN: GitHub access token
Secrets are automatically loaded from KeePassXC using Chezmoi template functions.
- Automatic man page path configuration
- VS Code shell integration
- Custom Git pathspec configuration (
_GIT_PATHSPEC) - Automatic completion generation for various tools
- Performance optimization through caching
- Integration with macOS system appearance changes

