Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a4e0c04de4
|
+11
-23
@@ -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"
|
||||||
@@ -115,7 +103,7 @@ function config_help --description 'Open the offline fish shell configuration ma
|
|||||||
set found_text $kv[2]
|
set found_text $kv[2]
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end <"$idx_file"
|
end < "$idx_file"
|
||||||
end
|
end
|
||||||
|
|
||||||
# ── Normalized scan fallback ─────────────────────────────
|
# ── Normalized scan fallback ─────────────────────────────
|
||||||
@@ -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
|
||||||
@@ -172,7 +160,7 @@ function config_help --description 'Open the offline fish shell configuration ma
|
|||||||
end | ov $ov_args
|
end | ov $ov_args
|
||||||
end
|
end
|
||||||
|
|
||||||
# ov alone: section navigation on raw Markdown; no code highlighting.
|
# ov alone: section navigation on raw Markdown; no code highlighting.
|
||||||
else if type -q ov
|
else if type -q ov
|
||||||
set -l ov_args \
|
set -l ov_args \
|
||||||
--header 1 \
|
--header 1 \
|
||||||
@@ -190,7 +178,7 @@ function config_help --description 'Open the offline fish shell configuration ma
|
|||||||
end | ov $ov_args
|
end | ov $ov_args
|
||||||
end
|
end
|
||||||
|
|
||||||
# bat alone: syntax highlighting with built-in paging; no line jump.
|
# bat alone: syntax highlighting with built-in paging; no line jump.
|
||||||
else if type -q bat
|
else if type -q bat
|
||||||
if test $start_line -gt 1
|
if test $start_line -gt 1
|
||||||
set_color brblack
|
set_color brblack
|
||||||
@@ -199,7 +187,7 @@ function config_help --description 'Open the offline fish shell configuration ma
|
|||||||
end
|
end
|
||||||
bat --language=markdown --paging=always "$doc_file"
|
bat --language=markdown --paging=always "$doc_file"
|
||||||
|
|
||||||
# Pre-compiled man page (generated by CI after merge).
|
# Pre-compiled man page (generated by CI after merge).
|
||||||
else if test -f "$man_file"
|
else if test -f "$man_file"
|
||||||
man -l "$man_file"
|
man -l "$man_file"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user