Compare commits

..

1 Commits

Author SHA1 Message Date
rootiest a4e0c04de4 feat(config_help): colorize --help output
Section headers in bold blue, argument/flag names in yellow, command
examples in green, navigation keys in cyan, fallback chain numbers
dimmed. All reset to normal after each colored span.
2026-06-06 04:18:04 -04:00
+7 -19
View File
@@ -32,37 +32,27 @@
function config_help --description 'Open the offline fish shell configuration manual' function config_help --description 'Open the offline fish shell configuration manual'
# ── --help / -h ────────────────────────────────────────────── # ── --help / -h ──────────────────────────────────────────────
if contains -- --help $argv; or contains -- -h $argv if contains -- --help $argv; or contains -- -h $argv
set_color --bold set_color --bold; echo "config_help"; set_color normal
echo config_help
set_color normal
echo " — view the offline fish shell configuration manual" echo " — view the offline fish shell configuration manual"
echo "" echo ""
set_color --bold brblue set_color --bold brblue; echo "USAGE"; set_color normal
echo USAGE
set_color normal
echo " config_help "(set_color yellow)"[section]"(set_color normal) echo " config_help "(set_color yellow)"[section]"(set_color normal)
echo " config_help "(set_color yellow)"--help"(set_color normal) echo " config_help "(set_color yellow)"--help"(set_color normal)
echo "" echo ""
set_color --bold brblue set_color --bold brblue; echo "ARGUMENTS"; set_color normal
echo ARGUMENTS
set_color normal
echo " "(set_color yellow)"section"(set_color normal)" Optional keyword to jump to a matching section heading." echo " "(set_color yellow)"section"(set_color normal)" Optional keyword to jump to a matching section heading."
echo " Searches docs/fish-config.index for aliases first, then" echo " Searches docs/fish-config.index for aliases first, then"
echo " falls back to a normalized (case- and punctuation-insensitive)" echo " falls back to a normalized (case- and punctuation-insensitive)"
echo " scan of heading lines." echo " scan of heading lines."
echo "" echo ""
set_color --bold brblue set_color --bold brblue; echo "EXAMPLES"; set_color normal
echo EXAMPLES
set_color normal
echo " "(set_color green)"config_help"(set_color normal)" open at top" echo " "(set_color green)"config_help"(set_color normal)" open at top"
echo " "(set_color green)"config_help keybindings"(set_color normal)" jump to Key Bindings section" echo " "(set_color green)"config_help keybindings"(set_color normal)" jump to Key Bindings section"
echo " "(set_color green)"config_help pkg"(set_color normal)" jump to the pkg function entry" echo " "(set_color green)"config_help pkg"(set_color normal)" jump to the pkg function entry"
echo " "(set_color green)"config_help fish-deps"(set_color normal)" jump to fish-deps" echo " "(set_color green)"config_help fish-deps"(set_color normal)" jump to fish-deps"
echo " "(set_color green)"config_help abbreviations"(set_color normal)" jump to Abbreviations section" echo " "(set_color green)"config_help abbreviations"(set_color normal)" jump to Abbreviations section"
echo "" echo ""
set_color --bold brblue set_color --bold brblue; echo "NAVIGATION (ov pager)"; set_color normal
echo "NAVIGATION (ov pager)"
set_color normal
echo " "(set_color cyan)"Space"(set_color normal)" next section" echo " "(set_color cyan)"Space"(set_color normal)" next section"
echo " "(set_color cyan)"^"(set_color normal)" previous section" echo " "(set_color cyan)"^"(set_color normal)" previous section"
echo " "(set_color cyan)"Alt+u"(set_color normal)" toggle section list sidebar" echo " "(set_color cyan)"Alt+u"(set_color normal)" toggle section list sidebar"
@@ -71,9 +61,7 @@ function config_help --description 'Open the offline fish shell configuration ma
echo " "(set_color cyan)"g"(set_color normal)" go to line number" echo " "(set_color cyan)"g"(set_color normal)" go to line number"
echo " "(set_color cyan)"q"(set_color normal)" quit" echo " "(set_color cyan)"q"(set_color normal)" quit"
echo "" echo ""
set_color --bold brblue set_color --bold brblue; echo "PAGER FALLBACK CHAIN"; set_color normal
echo "PAGER FALLBACK CHAIN"
set_color normal
echo " "(set_color brblack)"1."(set_color normal)" ov + bat section nav + syntax highlighting "(set_color brblack)"(best)"(set_color normal) echo " "(set_color brblack)"1."(set_color normal)" ov + bat section nav + syntax highlighting "(set_color brblack)"(best)"(set_color normal)
echo " "(set_color brblack)"2."(set_color normal)" ov alone section nav, raw Markdown" echo " "(set_color brblack)"2."(set_color normal)" ov alone section nav, raw Markdown"
echo " "(set_color brblack)"3."(set_color normal)" bat alone syntax highlighting, use / to search" echo " "(set_color brblack)"3."(set_color normal)" bat alone syntax highlighting, use / to search"
@@ -147,7 +135,7 @@ function config_help --description 'Open the offline fish shell configuration ma
# Prepended to the ov input stream and pinned via --header 1 so it # Prepended to the ov input stream and pinned via --header 1 so it
# remains visible at the top of the screen at all times. # remains visible at the top of the screen at all times.
set -l nav_hint \ set -l nav_hint \
" \033[2mNAVIGATION: [ Space=next section ^=prev Alt+u=sections /=search q=quit ]\033[0m" " \033[2m[ Space=next section ^=prev Alt+u=sections /=search q=quit ]\033[0m"
# ── Viewer fallback chain ──────────────────────────────────── # ── Viewer fallback chain ────────────────────────────────────
# When jumping to a section, slice the file from start_line so ov # When jumping to a section, slice the file from start_line so ov