refactor(config): migrate multi-category files and config.fish to named sites
Adds multi-site `# COMPONENT` headers and converts every guard call site in conf.d/tricks.fish, conf.d/abbr.fish, functions/smart_exit.fish, conf.d/yay-wrapper.fish, conf.d/paru-wrapper.fish, conf.d/wakatime.fish, conf.d/first_run.fish, and config.fish (9 sites across 3 categories) to the self-identifying `(status current-function|basename) <site>` calling convention. Regenerates conf.d/__fish_config_op_registry.fish.
This commit is contained in:
@@ -11,6 +11,8 @@ set -g __fish_config_op_registry_keys \
|
|||||||
__fish_config_sync_logging: \
|
__fish_config_sync_logging: \
|
||||||
__fish_user_dots_link: \
|
__fish_user_dots_link: \
|
||||||
_zellij_dump_log: \
|
_zellij_dump_log: \
|
||||||
|
abbr:abbr-integrations \
|
||||||
|
abbr:abbr-overrides \
|
||||||
agy: \
|
agy: \
|
||||||
auto-pull: \
|
auto-pull: \
|
||||||
autopair: \
|
autopair: \
|
||||||
@@ -18,9 +20,20 @@ set -g __fish_config_op_registry_keys \
|
|||||||
bash_expands: \
|
bash_expands: \
|
||||||
cat: \
|
cat: \
|
||||||
claude: \
|
claude: \
|
||||||
|
config:cachyos-strip-aliases \
|
||||||
|
config:cachyos-strip-overrides \
|
||||||
|
config:cachyos-tricks \
|
||||||
|
config:cdpath \
|
||||||
|
config:exit-wiring \
|
||||||
|
config:greeting-stamp \
|
||||||
|
config:pager-editor-gpg \
|
||||||
|
config:path-setup \
|
||||||
|
config:vi-mode \
|
||||||
done: \
|
done: \
|
||||||
du: \
|
du: \
|
||||||
edit: \
|
edit: \
|
||||||
|
first_run:first-run-bootstrap \
|
||||||
|
first_run:first-run-greeting \
|
||||||
fish_right_prompt: \
|
fish_right_prompt: \
|
||||||
help: \
|
help: \
|
||||||
hist: \
|
hist: \
|
||||||
@@ -32,10 +45,14 @@ set -g __fish_config_op_registry_keys \
|
|||||||
ls: \
|
ls: \
|
||||||
mkdir: \
|
mkdir: \
|
||||||
mv: \
|
mv: \
|
||||||
|
paru-wrapper:paru-autoexec \
|
||||||
|
paru-wrapper:paru-logging \
|
||||||
ping: \
|
ping: \
|
||||||
puffer: \
|
puffer: \
|
||||||
rg: \
|
rg: \
|
||||||
rm: \
|
rm: \
|
||||||
|
smart_exit:exit-plain \
|
||||||
|
smart_exit:logging-guard \
|
||||||
split: \
|
split: \
|
||||||
spwin: \
|
spwin: \
|
||||||
ssh: \
|
ssh: \
|
||||||
@@ -44,7 +61,13 @@ set -g __fish_config_op_registry_keys \
|
|||||||
theme: \
|
theme: \
|
||||||
tmux-logging: \
|
tmux-logging: \
|
||||||
top: \
|
top: \
|
||||||
|
tricks:aliases-tricks \
|
||||||
|
tricks:overrides-tricks \
|
||||||
upgrade: \
|
upgrade: \
|
||||||
|
wakatime:wakatime-autoexec \
|
||||||
|
wakatime:wakatime-hook \
|
||||||
|
yay-wrapper:yay-autoexec \
|
||||||
|
yay-wrapper:yay-logging \
|
||||||
yt-dlp: \
|
yt-dlp: \
|
||||||
zoxide:
|
zoxide:
|
||||||
|
|
||||||
@@ -53,6 +76,8 @@ set -g __fish_config_op_registry_values \
|
|||||||
"logging/terminal-capture" \
|
"logging/terminal-capture" \
|
||||||
"autoexec/sync" \
|
"autoexec/sync" \
|
||||||
"logging/multiplexer-capture" \
|
"logging/multiplexer-capture" \
|
||||||
|
"integrations/terminal-abbrs" \
|
||||||
|
"overrides/key-bindings" \
|
||||||
"aliases/dev-tools" \
|
"aliases/dev-tools" \
|
||||||
"autoexec/sync autoexec/sync" \
|
"autoexec/sync autoexec/sync" \
|
||||||
"overrides/key-bindings" \
|
"overrides/key-bindings" \
|
||||||
@@ -60,9 +85,20 @@ set -g __fish_config_op_registry_values \
|
|||||||
"overrides/key-bindings" \
|
"overrides/key-bindings" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
"aliases/dev-tools" \
|
"aliases/dev-tools" \
|
||||||
|
"aliases/filesystem" \
|
||||||
|
"overrides/key-bindings" \
|
||||||
|
"aliases/filesystem" \
|
||||||
|
"overrides/environment" \
|
||||||
|
"overrides/key-bindings" \
|
||||||
|
"greeting/greeting-message" \
|
||||||
|
"overrides/environment" \
|
||||||
|
"overrides/environment" \
|
||||||
|
"overrides/key-bindings" \
|
||||||
"integrations/notifications" \
|
"integrations/notifications" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
"aliases/dev-tools" \
|
"aliases/dev-tools" \
|
||||||
|
"autoexec/plugin-management" \
|
||||||
|
"greeting/first-run" \
|
||||||
"overrides/prompt" \
|
"overrides/prompt" \
|
||||||
"aliases/shell-tools" \
|
"aliases/shell-tools" \
|
||||||
"integrations/history-logs" \
|
"integrations/history-logs" \
|
||||||
@@ -74,10 +110,14 @@ set -g __fish_config_op_registry_values \
|
|||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
|
"autoexec/pkg-wrappers" \
|
||||||
|
"logging/pkg-logs" \
|
||||||
"aliases/network" \
|
"aliases/network" \
|
||||||
"overrides/key-bindings" \
|
"overrides/key-bindings" \
|
||||||
"aliases/search" \
|
"aliases/search" \
|
||||||
"aliases/filesystem" \
|
"aliases/filesystem" \
|
||||||
|
"overrides/key-bindings" \
|
||||||
|
"logging/terminal-capture" \
|
||||||
"integrations/window-mgmt" \
|
"integrations/window-mgmt" \
|
||||||
"integrations/window-mgmt" \
|
"integrations/window-mgmt" \
|
||||||
"aliases/network" \
|
"aliases/network" \
|
||||||
@@ -86,7 +126,13 @@ set -g __fish_config_op_registry_values \
|
|||||||
"overrides/prompt" \
|
"overrides/prompt" \
|
||||||
"logging/multiplexer-capture" \
|
"logging/multiplexer-capture" \
|
||||||
"aliases/monitor" \
|
"aliases/monitor" \
|
||||||
|
"aliases/filesystem" \
|
||||||
|
"overrides/environment" \
|
||||||
"integrations/pkg-upgrade" \
|
"integrations/pkg-upgrade" \
|
||||||
|
"autoexec/telemetry" \
|
||||||
|
"integrations/notifications" \
|
||||||
|
"autoexec/pkg-wrappers" \
|
||||||
|
"logging/pkg-logs" \
|
||||||
"aliases/network" \
|
"aliases/network" \
|
||||||
"aliases/filesystem"
|
"aliases/filesystem"
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -8,6 +8,10 @@
|
|||||||
# This file contains all the abbreviations for the terminal.
|
# This file contains all the abbreviations for the terminal.
|
||||||
# It is sourced by Fish on startup.
|
# It is sourced by Fish on startup.
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site abbr-integrations: integrations/terminal-abbrs
|
||||||
|
# site abbr-overrides: overrides/key-bindings
|
||||||
|
|
||||||
# Neovim
|
# Neovim
|
||||||
# @category Editors
|
# @category Editors
|
||||||
# @desc nvim
|
# @desc nvim
|
||||||
@@ -155,7 +159,7 @@ abbr -a ag. agy .
|
|||||||
# @desc exit
|
# @desc exit
|
||||||
abbr -a /exit exit
|
abbr -a /exit exit
|
||||||
# Window-management abbreviations are opinionated (C4 integrations)
|
# Window-management abbreviations are opinionated (C4 integrations)
|
||||||
if __fish_config_op_enabled __fish_config_op_integrations
|
if __fish_config_op_enabled (status basename) abbr-integrations
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
# @category Terminal Windows, Tabs, and Panes
|
# @category Terminal Windows, Tabs, and Panes
|
||||||
# @desc Close current pane/window
|
# @desc Close current pane/window
|
||||||
@@ -208,7 +212,7 @@ abbr -a speedtest-fast fast-cli
|
|||||||
|
|
||||||
# Kitty/WezTerm window-management abbreviations are opinionated (C4
|
# Kitty/WezTerm window-management abbreviations are opinionated (C4
|
||||||
# integrations): they assume an active Kitty or WezTerm session.
|
# integrations): they assume an active Kitty or WezTerm session.
|
||||||
if __fish_config_op_enabled __fish_config_op_integrations
|
if __fish_config_op_enabled (status basename) abbr-integrations
|
||||||
# Window Creation (OS Windows)
|
# Window Creation (OS Windows)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
# @category Terminal Windows, Tabs, and Panes
|
# @category Terminal Windows, Tabs, and Panes
|
||||||
@@ -666,7 +670,7 @@ abbr -a url-open open-url
|
|||||||
### History Expansions and Substitutions ###
|
### History Expansions and Substitutions ###
|
||||||
# Bash-style history expansion is opinionated (C3 overrides), gated atomically
|
# Bash-style history expansion is opinionated (C3 overrides), gated atomically
|
||||||
# with conf.d/tricks.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
# with conf.d/tricks.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) abbr-overrides
|
||||||
# @category History Expansion
|
# @category History Expansion
|
||||||
# @name !^
|
# @name !^
|
||||||
# @desc Expand to the first argument of the previous command
|
# @desc Expand to the first argument of the previous command
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
#
|
#
|
||||||
# Runs exactly once on the first interactive fish session after install.
|
# Runs exactly once on the first interactive fish session after install.
|
||||||
# To reset for testing, run: set -Ue __fish_config_first_run_complete
|
# To reset for testing, run: set -Ue __fish_config_first_run_complete
|
||||||
|
#
|
||||||
|
# COMPONENT
|
||||||
|
# site first-run-greeting: greeting/first-run
|
||||||
|
# site first-run-bootstrap: autoexec/plugin-management
|
||||||
|
|
||||||
# Exit early in non-interactive shells (scripts, completions, subshells)
|
# Exit early in non-interactive shells (scripts, completions, subshells)
|
||||||
if not status is-interactive
|
if not status is-interactive
|
||||||
@@ -36,7 +40,7 @@ end
|
|||||||
# Printing a first-run welcome banner is opinionated (C6 greeting). The
|
# Printing a first-run welcome banner is opinionated (C6 greeting). The
|
||||||
# first-run state variable is already set unconditionally above, so
|
# first-run state variable is already set unconditionally above, so
|
||||||
# disabling the greeting never re-triggers this file.
|
# disabling the greeting never re-triggers this file.
|
||||||
if __fish_config_op_enabled __fish_config_op_greeting
|
if __fish_config_op_enabled (status basename) first-run-greeting
|
||||||
echo ""
|
echo ""
|
||||||
echo " Welcome to your fish shell configuration!"
|
echo " Welcome to your fish shell configuration!"
|
||||||
echo " Run 'help config' for offline documentation."
|
echo " Run 'help config' for offline documentation."
|
||||||
@@ -48,7 +52,7 @@ end
|
|||||||
# Startup side-effects below (Fisher curl, fisher update, theme apply) are
|
# Startup side-effects below (Fisher curl, fisher update, theme apply) are
|
||||||
# opinionated (C2 auto-execution). The first-run state variable is already
|
# opinionated (C2 auto-execution). The first-run state variable is already
|
||||||
# set above either way, so disabling auto-exec never re-triggers this file.
|
# set above either way, so disabling auto-exec never re-triggers this file.
|
||||||
if not __fish_config_op_enabled __fish_config_op_autoexec
|
if not __fish_config_op_enabled (status basename) first-run-bootstrap
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,16 @@
|
|||||||
# bars are preserved, renders the captured animation to a clean static log
|
# bars are preserved, renders the captured animation to a clean static log
|
||||||
# (via scripts/clean_progress_log.py), and prunes old logs.
|
# (via scripts/clean_progress_log.py), and prunes old logs.
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site paru-autoexec: autoexec/pkg-wrappers
|
||||||
|
# site paru-logging: logging/pkg-logs
|
||||||
|
|
||||||
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
|
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
|
||||||
# Wrapper generation is also gated by C5 (Logging & Capture).
|
# Wrapper generation is also gated by C5 (Logging & Capture).
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or return
|
__fish_config_op_enabled (status basename) paru-autoexec; or return
|
||||||
|
|
||||||
# C5 — Logging & Capture: remove generated wrapper and skip when logging is off
|
# C5 — Logging & Capture: remove generated wrapper and skip when logging is off
|
||||||
if not __fish_config_op_enabled __fish_config_op_logging
|
if not __fish_config_op_enabled (status basename) paru-logging
|
||||||
if test -f "$HOME/.local/bin/paru"
|
if test -f "$HOME/.local/bin/paru"
|
||||||
and grep -q "# paru-wrapper-version:" "$HOME/.local/bin/paru" 2>/dev/null
|
and grep -q "# paru-wrapper-version:" "$HOME/.local/bin/paru" 2>/dev/null
|
||||||
rm -f "$HOME/.local/bin/paru"
|
rm -f "$HOME/.local/bin/paru"
|
||||||
|
|||||||
+8
-4
@@ -7,6 +7,10 @@
|
|||||||
# │ system aliases, and history/backup utilities │
|
# │ system aliases, and history/backup utilities │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site aliases-tricks: aliases/filesystem
|
||||||
|
# site overrides-tricks: overrides/environment
|
||||||
|
|
||||||
## Environment setup
|
## Environment setup
|
||||||
# Apply .profile: use this to put fish compatible .profile stuff in
|
# Apply .profile: use this to put fish compatible .profile stuff in
|
||||||
if test -f ~/.fish_profile
|
if test -f ~/.fish_profile
|
||||||
@@ -24,7 +28,7 @@ end
|
|||||||
|
|
||||||
# Format man pages using bat (only if bat is installed)
|
# Format man pages using bat (only if bat is installed)
|
||||||
# Overriding $MANPAGER is opinionated (C3 overrides)
|
# Overriding $MANPAGER is opinionated (C3 overrides)
|
||||||
if type -q bat; and __fish_config_op_enabled __fish_config_op_overrides
|
if type -q bat; and __fish_config_op_enabled (status basename) overrides-tricks
|
||||||
set -gx MANROFFOPT -c
|
set -gx MANROFFOPT -c
|
||||||
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||||
end
|
end
|
||||||
@@ -37,7 +41,7 @@ set -gx __done_notification_urgency_level low
|
|||||||
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
||||||
# The bang-bang system is opinionated (C3 overrides) and is gated atomically
|
# The bang-bang system is opinionated (C3 overrides) and is gated atomically
|
||||||
# here, in conf.d/abbr.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
# here, in conf.d/abbr.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) overrides-tricks
|
||||||
function __history_previous_command
|
function __history_previous_command
|
||||||
switch (commandline -t)
|
switch (commandline -t)
|
||||||
case "!"
|
case "!"
|
||||||
@@ -83,7 +87,7 @@ end
|
|||||||
# Fish command history override to show timestamps
|
# Fish command history override to show timestamps
|
||||||
# Shadowing the history command is opinionated (C1 aliasing); when disabled,
|
# Shadowing the history command is opinionated (C1 aliasing); when disabled,
|
||||||
# the function is never defined and fish's stock history behavior applies.
|
# the function is never defined and fish's stock history behavior applies.
|
||||||
if __fish_config_op_enabled __fish_config_op_aliases
|
if __fish_config_op_enabled (status basename) aliases-tricks
|
||||||
function history
|
function history
|
||||||
builtin history --show-time='%F %T '
|
builtin history --show-time='%F %T '
|
||||||
end
|
end
|
||||||
@@ -123,7 +127,7 @@ alias .....='cd ../../../..'
|
|||||||
alias ......='cd ../../../../..'
|
alias ......='cd ../../../../..'
|
||||||
|
|
||||||
# Silent flag injection into POSIX tools is opinionated (C1 aliasing)
|
# Silent flag injection into POSIX tools is opinionated (C1 aliasing)
|
||||||
if __fish_config_op_enabled __fish_config_op_aliases
|
if __fish_config_op_enabled (status basename) aliases-tricks
|
||||||
# Tools & Core command color overrides
|
# Tools & Core command color overrides
|
||||||
# @category Shell Aliases
|
# @category Shell Aliases
|
||||||
# @desc dir --color=auto
|
# @desc dir --color=auto
|
||||||
|
|||||||
@@ -5,11 +5,15 @@
|
|||||||
# see: https://github.com/ik11235/wakatime.fish
|
# see: https://github.com/ik11235/wakatime.fish
|
||||||
###
|
###
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site wakatime-autoexec: autoexec/telemetry
|
||||||
|
# site wakatime-hook: integrations/notifications
|
||||||
|
|
||||||
# Local modification: opinionated guard (AGENTS.md Task #3). WakaTime
|
# Local modification: opinionated guard (AGENTS.md Task #3). WakaTime
|
||||||
# reporting is classified under both C2 auto-execution and C4 integrations;
|
# reporting is classified under both C2 auto-execution and C4 integrations;
|
||||||
# disabling either category skips registering the hook.
|
# disabling either category skips registering the hook.
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or exit
|
__fish_config_op_enabled (status basename) wakatime-autoexec; or exit
|
||||||
__fish_config_op_enabled __fish_config_op_integrations; or exit
|
__fish_config_op_enabled (status basename) wakatime-hook; or exit
|
||||||
|
|
||||||
function __register_wakatime_fish_before_exec -e fish_postexec
|
function __register_wakatime_fish_before_exec -e fish_postexec
|
||||||
if set -q FISH_WAKATIME_DISABLED
|
if set -q FISH_WAKATIME_DISABLED
|
||||||
|
|||||||
@@ -6,12 +6,16 @@
|
|||||||
# bars are preserved, renders the captured animation to a clean static log
|
# bars are preserved, renders the captured animation to a clean static log
|
||||||
# (via scripts/clean_progress_log.py), and prunes old logs.
|
# (via scripts/clean_progress_log.py), and prunes old logs.
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site yay-autoexec: autoexec/pkg-wrappers
|
||||||
|
# site yay-logging: logging/pkg-logs
|
||||||
|
|
||||||
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
|
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
|
||||||
# Wrapper generation is also gated by C5 (Logging & Capture).
|
# Wrapper generation is also gated by C5 (Logging & Capture).
|
||||||
__fish_config_op_enabled __fish_config_op_autoexec; or return
|
__fish_config_op_enabled (status basename) yay-autoexec; or return
|
||||||
|
|
||||||
# C5 — Logging & Capture: remove generated wrapper and skip when logging is off
|
# C5 — Logging & Capture: remove generated wrapper and skip when logging is off
|
||||||
if not __fish_config_op_enabled __fish_config_op_logging
|
if not __fish_config_op_enabled (status basename) yay-logging
|
||||||
if test -f "$HOME/.local/bin/yay"
|
if test -f "$HOME/.local/bin/yay"
|
||||||
and grep -q "# yay-wrapper-version:" "$HOME/.local/bin/yay" 2>/dev/null
|
and grep -q "# yay-wrapper-version:" "$HOME/.local/bin/yay" 2>/dev/null
|
||||||
rm -f "$HOME/.local/bin/yay"
|
rm -f "$HOME/.local/bin/yay"
|
||||||
|
|||||||
+20
-9
@@ -21,12 +21,23 @@
|
|||||||
# C5 is the one exception: it defaults to disabled and needs an explicit
|
# C5 is the one exception: it defaults to disabled and needs an explicit
|
||||||
# truthy value — set -U __fish_config_op_logging on
|
# truthy value — set -U __fish_config_op_logging on
|
||||||
|
|
||||||
|
# COMPONENT
|
||||||
|
# site cachyos-tricks: aliases/filesystem
|
||||||
|
# site cachyos-strip-aliases: aliases/filesystem
|
||||||
|
# site cachyos-strip-overrides: overrides/key-bindings
|
||||||
|
# site pager-editor-gpg: overrides/environment
|
||||||
|
# site exit-wiring: overrides/key-bindings
|
||||||
|
# site path-setup: overrides/environment
|
||||||
|
# site cdpath: overrides/environment
|
||||||
|
# site vi-mode: overrides/key-bindings
|
||||||
|
# site greeting-stamp: greeting/greeting-message
|
||||||
|
|
||||||
# ──────────────────────── Source CachyOS configs ────────────────────────
|
# ──────────────────────── Source CachyOS configs ────────────────────────
|
||||||
if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
||||||
source /usr/share/cachyos-fish-config/cachyos-config.fish
|
source /usr/share/cachyos-fish-config/cachyos-config.fish
|
||||||
# Surgically overriding the distro config is opinionated (C3 overrides):
|
# Surgically overriding the distro config is opinionated (C3 overrides):
|
||||||
# skip it entirely when overrides are disabled, keeping CachyOS defaults.
|
# skip it entirely when overrides are disabled, keeping CachyOS defaults.
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) cachyos-tricks
|
||||||
# Source our tricks over the cachyOS config
|
# Source our tricks over the cachyOS config
|
||||||
test -f "$__fish_config_dir/conf.d/tricks.fish"
|
test -f "$__fish_config_dir/conf.d/tricks.fish"
|
||||||
and source "$__fish_config_dir/conf.d/tricks.fish"
|
and source "$__fish_config_dir/conf.d/tricks.fish"
|
||||||
@@ -41,7 +52,7 @@ if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
|||||||
# The distro config ships opinionated pieces of its own (it is the origin
|
# The distro config ships opinionated pieces of its own (it is the origin
|
||||||
# of tricks.fish); strip them when the matching category is disabled so
|
# of tricks.fish); strip them when the matching category is disabled so
|
||||||
# the guards hold on CachyOS systems too.
|
# the guards hold on CachyOS systems too.
|
||||||
if not __fish_config_op_enabled __fish_config_op_aliases
|
if not __fish_config_op_enabled (status basename) cachyos-strip-aliases
|
||||||
for _fname in grep fgrep egrep dir vdir wget
|
for _fname in grep fgrep egrep dir vdir wget
|
||||||
functions -q $_fname; and functions --erase $_fname
|
functions -q $_fname; and functions --erase $_fname
|
||||||
end
|
end
|
||||||
@@ -53,7 +64,7 @@ if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
|||||||
and source $__fish_data_dir/functions/$_fname.fish
|
and source $__fish_data_dir/functions/$_fname.fish
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not __fish_config_op_enabled __fish_config_op_overrides
|
if not __fish_config_op_enabled (status basename) cachyos-strip-overrides
|
||||||
for _fname in __history_previous_command __history_previous_command_arguments
|
for _fname in __history_previous_command __history_previous_command_arguments
|
||||||
functions -q $_fname; and functions --erase $_fname
|
functions -q $_fname; and functions --erase $_fname
|
||||||
end
|
end
|
||||||
@@ -95,7 +106,7 @@ set -q WORDLIST; or set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US"
|
|||||||
|
|
||||||
# ─────────────────────────── Pager variables ────────────────────────────
|
# ─────────────────────────── Pager variables ────────────────────────────
|
||||||
# Overriding $PAGER, $EDITOR, and $GPG_TTY 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 (status basename) pager-editor-gpg
|
||||||
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
|
||||||
@@ -136,7 +147,7 @@ and set -gx SCROLLBACK_HISTORY_MAX_FILES $__fish_scrollback_history_max_files
|
|||||||
# Wire up a clean exit function that won't fire on background subshells
|
# Wire up a clean exit function that won't fire on background subshells
|
||||||
# Replacing the exit builtin is opinionated (C3 overrides); smart_exit also
|
# Replacing the exit builtin is opinionated (C3 overrides); smart_exit also
|
||||||
# guards itself so a live toggle takes effect without restarting the shell.
|
# guards itself so a live toggle takes effect without restarting the shell.
|
||||||
if status is-interactive; and __fish_config_op_enabled __fish_config_op_overrides
|
if status is-interactive; and __fish_config_op_enabled (status basename) exit-wiring
|
||||||
function exit --description 'Safe interactive exit'
|
function exit --description 'Safe interactive exit'
|
||||||
# If the smart_exit file exists in our function path, invoke it explicitly
|
# If the smart_exit file exists in our function path, invoke it explicitly
|
||||||
if functions -q smart_exit
|
if functions -q smart_exit
|
||||||
@@ -153,7 +164,7 @@ end
|
|||||||
# the cargo bin directory is moved to the end of the PATH, which can help avoid conflicts
|
# the cargo bin directory is moved to the end of the PATH, which can help avoid conflicts
|
||||||
# with system-installed Rust tools while still allowing user-installed cargo binaries to be found.
|
# with system-installed Rust tools while still allowing user-installed cargo binaries to be found.
|
||||||
# PATH setup is opinionated (C3 overrides)
|
# PATH setup is opinionated (C3 overrides)
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) path-setup
|
||||||
fish_add_path $HOME/.local/bin # Standard user-local executables (XDG spec)
|
fish_add_path $HOME/.local/bin # Standard user-local executables (XDG spec)
|
||||||
fish_add_path $HOME/.local/share/../bin # Alternative/legacy path for local user binaries
|
fish_add_path $HOME/.local/share/../bin # Alternative/legacy path for local user binaries
|
||||||
fish_add_path $HOME/Applications # User-installed applications and standalone apps
|
fish_add_path $HOME/Applications # User-installed applications and standalone apps
|
||||||
@@ -176,7 +187,7 @@ end
|
|||||||
# so if you have a directory named 'myproject' in the current directory,
|
# so if you have a directory named 'myproject' in the current directory,
|
||||||
# running 'cd myproject' will take you there instead of $HOME/projects/myproject.
|
# running 'cd myproject' will take you there instead of $HOME/projects/myproject.
|
||||||
# CDPATH injection is opinionated (C3 overrides)
|
# CDPATH injection is opinionated (C3 overrides)
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) cdpath
|
||||||
set -gx CDPATH . $HOME/projects $HOME
|
set -gx CDPATH . $HOME/projects $HOME
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -191,7 +202,7 @@ if status is-interactive
|
|||||||
# This is optional but can improve the user experience for those who prefer Vi-style key bindings.
|
# This is optional but can improve the user experience for those who prefer Vi-style key bindings.
|
||||||
# Global Vi mode is opinionated (C3 overrides); without it fish keeps its
|
# Global Vi mode is opinionated (C3 overrides); without it fish keeps its
|
||||||
# default Emacs-style bindings.
|
# default Emacs-style bindings.
|
||||||
if __fish_config_op_enabled __fish_config_op_overrides
|
if __fish_config_op_enabled (status basename) vi-mode
|
||||||
set -g fish_key_bindings fish_vi_key_bindings
|
set -g fish_key_bindings fish_vi_key_bindings
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -251,7 +262,7 @@ if status is-interactive
|
|||||||
# function that distro configs set (e.g., CachyOS defines it as fastfetch).
|
# function that distro configs set (e.g., CachyOS defines it as fastfetch).
|
||||||
# This runs last inside the interactive block so our empty definition wins
|
# This runs last inside the interactive block so our empty definition wins
|
||||||
# over whatever cachyos-config.fish or vendor conf.d installed.
|
# over whatever cachyos-config.fish or vendor conf.d installed.
|
||||||
if not __fish_config_op_enabled __fish_config_op_greeting
|
if not __fish_config_op_enabled (status basename) greeting-stamp
|
||||||
function fish_greeting
|
function fish_greeting
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
# CATEGORY
|
# CATEGORY
|
||||||
# 11-pager-and-logging
|
# 11-pager-and-logging
|
||||||
#
|
#
|
||||||
|
# COMPONENT
|
||||||
|
# site exit-plain: overrides/key-bindings
|
||||||
|
# site logging-guard: logging/terminal-capture
|
||||||
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# smart_exit [-h] [-n]
|
# smart_exit [-h] [-n]
|
||||||
#
|
#
|
||||||
@@ -32,7 +36,7 @@ function smart_exit --description 'Capture colorized scrollback before exiting,
|
|||||||
# Opinionated guard (C3): exit plainly when overrides are disabled.
|
# Opinionated guard (C3): exit plainly when overrides are disabled.
|
||||||
# This composes with Task #4's __fish_config_enable_logging, which will
|
# This composes with Task #4's __fish_config_enable_logging, which will
|
||||||
# gate only the scrollback capture while leaving the exit wrapper active.
|
# gate only the scrollback capture while leaving the exit wrapper active.
|
||||||
if not __fish_config_op_enabled __fish_config_op_overrides
|
if not __fish_config_op_enabled (status current-function) exit-plain
|
||||||
builtin exit $argv
|
builtin exit $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -60,7 +64,7 @@ function smart_exit --description 'Capture colorized scrollback before exiting,
|
|||||||
# C5 — Logging & Capture: skip all capture when logging is disabled.
|
# C5 — Logging & Capture: skip all capture when logging is disabled.
|
||||||
# When disabled, tell Kitty the window is handled so its watcher doesn't
|
# When disabled, tell Kitty the window is handled so its watcher doesn't
|
||||||
# capture either — belt-and-suspenders alongside the sentinel file.
|
# capture either — belt-and-suspenders alongside the sentinel file.
|
||||||
if not __fish_config_op_enabled __fish_config_op_logging
|
if not __fish_config_op_enabled (status current-function) logging-guard
|
||||||
if test -n "$KITTY_WINDOW_ID"
|
if test -n "$KITTY_WINDOW_ID"
|
||||||
kitty @ set-user-vars "logged_by_shell=true" 2>/dev/null
|
kitty @ set-user-vars "logged_by_shell=true" 2>/dev/null
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user