fix(config): adjust XDG and EDITOR/GPG gates and sync docs

This commit is contained in:
2026-07-27 20:32:58 -04:00
parent d2f3da4a23
commit 7183ed712b
4 changed files with 47 additions and 46 deletions
+38 -39
View File
@@ -67,59 +67,58 @@ set --erase _fname
# ───────────────────────────── XDG variables ──────────────────────────── # ───────────────────────────── XDG variables ────────────────────────────
# XDG Base Directory variables (standard practice) # XDG Base Directory variables (standard practice)
# Setting XDG variables globally is opinionated (C3 overrides) # We set these unconditionally to ensure a consistent baseline, but only if
if __fish_config_op_enabled __fish_config_op_overrides # they are not already defined by the system/user.
set -gx XDG_CONFIG_HOME $HOME/.config # Sets default config dir to ~/.config set -q XDG_CONFIG_HOME; or set -gx XDG_CONFIG_HOME $HOME/.config # Sets default config dir to ~/.config
set -gx XDG_CACHE_HOME $HOME/.cache # Sets default cache dir to ~/.cache set -q XDG_CACHE_HOME; or set -gx XDG_CACHE_HOME $HOME/.cache # Sets default cache dir to ~/.cache
set -gx XDG_DATA_HOME $HOME/.local/share # Sets default data dir to ~/.local/share set -q XDG_DATA_HOME; or set -gx XDG_DATA_HOME $HOME/.local/share # Sets default data dir to ~/.local/share
set -gx XDG_STATE_HOME $HOME/.local/state # Sets default state dir to ~/.local/state set -q XDG_STATE_HOME; or set -gx XDG_STATE_HOME $HOME/.local/state # Sets default state dir to ~/.local/state
# Attempt to keep various config/cache files out of the home directory root # Attempt to keep various config/cache files out of the home directory root
set -gx RANDFILE "$XDG_STATE_HOME/rnd" set -q RANDFILE; or set -gx RANDFILE "$XDG_STATE_HOME/rnd"
set -gx WGETRC "$XDG_CONFIG_HOME/wget/wgetrc" set -q WGETRC; or set -gx WGETRC "$XDG_CONFIG_HOME/wget/wgetrc"
set -gx WGET_HSTS_FILE "$XDG_CACHE_HOME/wget-hsts" set -q WGET_HSTS_FILE; or set -gx WGET_HSTS_FILE "$XDG_CACHE_HOME/wget-hsts"
set -gx NPM_CONFIG_PREFIX "$XDG_DATA_HOME/npm-global" set -q NPM_CONFIG_PREFIX; or set -gx NPM_CONFIG_PREFIX "$XDG_DATA_HOME/npm-global"
set -gx NPM_CONFIG_USERCONFIG "$XDG_CONFIG_HOME/npm/npmrc" set -q NPM_CONFIG_USERCONFIG; or set -gx NPM_CONFIG_USERCONFIG "$XDG_CONFIG_HOME/npm/npmrc"
set -gx ANDROID_USER_HOME "$XDG_DATA_HOME/android" set -q ANDROID_USER_HOME; or set -gx ANDROID_USER_HOME "$XDG_DATA_HOME/android"
set -gx CARGO_HOME "$XDG_DATA_HOME/cargo" set -q CARGO_HOME; or set -gx CARGO_HOME "$XDG_DATA_HOME/cargo"
set -gx RUSTUP_HOME "$XDG_DATA_HOME/rustup" set -q RUSTUP_HOME; or set -gx RUSTUP_HOME "$XDG_DATA_HOME/rustup"
set -gx GOPATH "$XDG_DATA_HOME/go" set -q GOPATH; or set -gx GOPATH "$XDG_DATA_HOME/go"
set -gx BUN_INSTALL "$XDG_DATA_HOME/bun" set -q BUN_INSTALL; or set -gx BUN_INSTALL "$XDG_DATA_HOME/bun"
set -gx GNUPGHOME "$XDG_CONFIG_HOME/gnupg" set -q GNUPGHOME; or set -gx GNUPGHOME "$XDG_CONFIG_HOME/gnupg"
set -gx WAKATIME_HOME "$XDG_CONFIG_HOME/wakatime" set -q WAKATIME_HOME; or set -gx WAKATIME_HOME "$XDG_CONFIG_HOME/wakatime"
set -gx HISTFILE "$XDG_STATE_HOME/bash_history" set -q HISTFILE; or set -gx HISTFILE "$XDG_STATE_HOME/bash_history"
set -gx EXINIT "set viminfofile=$XDG_STATE_HOME/vim/viminfo | source $MYVIMRC" set -q EXINIT; or set -gx EXINIT "set viminfofile=$XDG_STATE_HOME/vim/viminfo | source $MYVIMRC"
set -gx NVIDIA_SETTINGS_RW_CONFIG_FILE "$XDG_CONFIG_HOME/nvidia/settings" set -q NVIDIA_SETTINGS_RW_CONFIG_FILE; or set -gx NVIDIA_SETTINGS_RW_CONFIG_FILE "$XDG_CONFIG_HOME/nvidia/settings"
set -gx CODEIUM_HOME "$XDG_CONFIG_HOME/codeium" set -q CODEIUM_HOME; or set -gx CODEIUM_HOME "$XDG_CONFIG_HOME/codeium"
set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US" set -q WORDLIST; or set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US"
end
# ─────────────────────────── Pager variables ──────────────────────────── # ─────────────────────────── Pager variables ────────────────────────────
# Overriding $PAGER is opinionated (C3 overrides) # Overriding $PAGER, $EDITOR, and $GPG_TTY is opinionated (C3 overrides)
if __fish_config_op_enabled __fish_config_op_overrides if __fish_config_op_enabled __fish_config_op_overrides
if type -q ov if type -q ov
set -gx PAGER ov set -gx PAGER ov
else if type -q less else if type -q less
set -gx PAGER less set -gx PAGER less
end end
end
# ─────────────────────────── Editor variables ─────────────────────────── # ─────────────────────────── Editor variables ───────────────────────────
# Set Editor variables with fallback to vi if nvim isn't available. This ensures that # Set Editor variables with fallback to vi if nvim isn't available. This ensures that
# tools that rely on these variables (like git commit messages) will work out of the box, # tools that rely on these variables (like git commit messages) will work out of the box,
# while still preferring nvim if it's installed. # while still preferring nvim if it's installed.
if type -q nvim if type -q nvim
set -gx NVIM_APPNAME nvim set -gx NVIM_APPNAME nvim
set -gx EDITOR (command -s nvim) set -gx EDITOR (command -s nvim)
else else
set -gx EDITOR (command -s vi) set -gx EDITOR (command -s vi)
end end
# set -gx VISUAL $EDITOR # <- Use local.fish to set your preferred GUI editor. # set -gx VISUAL $EDITOR # <- Use local.fish to set your preferred GUI editor.
set -gx SUDO_EDITOR $EDITOR set -gx SUDO_EDITOR $EDITOR
# ──────────────────────────── GPG variables ───────────────────────────── # ──────────────────────────── GPG variables ─────────────────────────────
# Helps ensure that GPG can prompt for passphrases correctly when invoked from the terminal. # Helps ensure that GPG can prompt for passphrases correctly when invoked from the terminal.
set -gx GPG_TTY (tty) set -gx GPG_TTY (tty)
end
# ────────────────────────── Scrollback History ────────────────────────── # ────────────────────────── Scrollback History ──────────────────────────
# Optional fish-style source of truth (set -U via config-settings); exported # Optional fish-style source of truth (set -U via config-settings); exported
+3 -2
View File
@@ -2857,10 +2857,11 @@ all of them.
Override What it replaces or sets Override What it replaces or sets
─────────────────────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────────────────────────
Vi mode fish_vi_key_bindings replaces default Emacs mode Vi mode fish_vi_key_bindings replaces default Emacs mode
XDG variables Sets global XDG Base Directory variables
PATH setup Prepends custom bin directories to the PATH PATH setup Prepends custom bin directories to the PATH
exit → smart_exit exit wrapper that captures scrollback before closing exit → smart_exit exit wrapper that captures scrollback before closing
PAGER=ov ov used by git, man, and all $PAGER-aware tools PAGER=ov ov used by git, man, and all $PAGER-aware tools
EDITOR=nvim nvim fallback to vi for git commit, etc.
GPG_TTY Sets GPG_TTY to current terminal tty
MANPAGER=bat pipeline man pages rendered with syntax highlighting MANPAGER=bat pipeline man pages rendered with syntax highlighting
CDPATH=. ~/projects ~ bare dir names resolve against ~/projects and ~ CDPATH=. ~/projects ~ bare dir names resolve against ~/projects and ~
Bang-bang system ! and $ keys expand history; !^, !*, !-N, !?str?, Bang-bang system ! and $ keys expand history; !^, !*, !-N, !?str?,
@@ -3480,7 +3481,7 @@ what C3 controls.
## What's with the C1-C6 stuff? ## What's with the C1-C6 stuff?
This configuration groups its opinionated behaviors into six categories (C1C6), allowing you to selectively disable features that conflict with your workflow. Disabling all of them leaves you with a "Minimal Mode" shell that only manages PATH, XDG variables, and your `local.fish` overrides. This configuration groups its opinionated behaviors into six categories (C1C6), allowing you to selectively disable features that conflict with your workflow. The **C**ategory numbers are used as shorthand when referencing these. Disabling all of them leaves you with a "Minimal Mode" shell that only manages basic features like `XDG` variables, and your `local.fish` overrides.
Category Description Category Description
────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────
+2 -1
View File
@@ -229,10 +229,11 @@ all of them.
Override What it replaces or sets Override What it replaces or sets
─────────────────────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────────────────────────
Vi mode fish_vi_key_bindings replaces default Emacs mode Vi mode fish_vi_key_bindings replaces default Emacs mode
XDG variables Sets global XDG Base Directory variables
PATH setup Prepends custom bin directories to the PATH PATH setup Prepends custom bin directories to the PATH
exit → smart_exit exit wrapper that captures scrollback before closing exit → smart_exit exit wrapper that captures scrollback before closing
PAGER=ov ov used by git, man, and all $PAGER-aware tools PAGER=ov ov used by git, man, and all $PAGER-aware tools
EDITOR=nvim nvim fallback to vi for git commit, etc.
GPG_TTY Sets GPG_TTY to current terminal tty
MANPAGER=bat pipeline man pages rendered with syntax highlighting MANPAGER=bat pipeline man pages rendered with syntax highlighting
CDPATH=. ~/projects ~ bare dir names resolve against ~/projects and ~ CDPATH=. ~/projects ~ bare dir names resolve against ~/projects and ~
Bang-bang system ! and $ keys expand history; !^, !*, !-N, !?str?, Bang-bang system ! and $ keys expand history; !^, !*, !-N, !?str?,
+1 -1
View File
@@ -204,7 +204,7 @@ what C3 controls.
## What's with the C1-C6 stuff? ## What's with the C1-C6 stuff?
This configuration groups its opinionated behaviors into six categories (C1C6), allowing you to selectively disable features that conflict with your workflow. Disabling all of them leaves you with a "Minimal Mode" shell that only manages PATH, XDG variables, and your `local.fish` overrides. This configuration groups its opinionated behaviors into six categories (C1C6), allowing you to selectively disable features that conflict with your workflow. The **C**ategory numbers are used as shorthand when referencing these. Disabling all of them leaves you with a "Minimal Mode" shell that only manages basic features like `XDG` variables, and your `local.fish` overrides.
Category Description Category Description
────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────