feat(config-help): add --html and --man flags; add config-update function

config-help gains two new flags:
- --html / -w: opens docs/html/index.html in the default browser using
  smart browser detection (xdg-mime https scheme handler → known binaries
  → xdg-open fallback) to avoid MIME-type mismatches with non-browser apps
- --man / -m: opens the compiled docs/fish-config.1 man page via man -l

config-update is a new function that pulls the latest fish config from the
hard-coded upstream URL without requiring a configured git remote. Suppresses
git output and reports status with colored messages. Supports --dry-run and
--force flags.

README updated to document all new commands.
This commit is contained in:
2026-06-08 15:27:47 -04:00
parent 9795164eda
commit de07040c16
4 changed files with 367 additions and 15 deletions
+60 -5
View File
@@ -1022,6 +1022,51 @@ These are implemented as keybinding helpers, but can also be typed:
## 5.14 Miscellaneous
### config-help
Synopsis: config-help [SECTION]
config-help --html
config-help --man
config-help -h | --help
Opens the offline fish shell configuration manual. Without flags, opens
the Markdown source in the best available pager (ov > bat > man > less >
cat). If SECTION is given, jumps to the first heading matching that
keyword (case-insensitive; checks fish-config.index aliases first).
Flags:
--html / -w Open docs/html/index.html in the default browser.
Detects the browser via xdg-mime x-scheme-handler/https,
then known binaries, then xdg-open as last resort.
Respects $fish_help_browser and $BROWSER.
--man / -m Open docs/fish-config.1 via man -l directly.
--help / -h Print usage and navigation key reference.
config-help keybindings
config-help pkg
config-help --html
config-help --man
### config-update
Synopsis: config-update [-h] [-n] [-f]
Pulls the latest fish configuration from the upstream repository
(https://git.rootiest.dev/rootiest/fish-config.git) into ~/.config/fish.
The remote URL is hard-coded, so this works on fresh clones with no git
remote configured. All git output is suppressed; colored messages report
fetch and merge status. After a successful pull, run `exec fish` to
reload.
Flags:
--dry-run / -n Fetch and show available commits without applying them.
--force / -f Stash local changes, pull, then restore the stash.
--help / -h Show usage.
config-update
config-update --dry-run
config-update --force
### bash
Synopsis: bash [args...]
@@ -1247,18 +1292,28 @@ navigation.
## As a man page
The symlink and MANPATH are configured automatically on shell start:
config-help --man
Opens the compiled docs/fish-config.1 directly via man -l, bypassing
the pager fallback chain. The symlink and MANPATH are also configured
automatically on shell start for the standard invocation:
man fish-config
Or read the compiled file directly:
man -l ~/.config/fish/docs/fish-config.1
NOTE: fish-config (hyphen) is this config's man page. fish_config
(underscore) is fish's built-in browser-based configuration tool —
a completely separate command. Do not mix them up.
## In the browser (HTML)
config-help --html
Opens docs/html/index.html in the default web browser. Browser detection
queries the system's x-scheme-handler/https MIME entry (via xdg-mime) to
find the real browser binary, then falls back through known browser
binaries (firefox, chromium, vivaldi, etc.), and finally xdg-open as a
last resort. Set $fish_help_browser or $BROWSER to override.
## Jumping to a section
help config keybindings