mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 21:43:55 +08:00
2b74affaf0
It's a bit weird to *have* to fire up a browser to get fish_config to choose a prompt. So this adds a `prompt` subcommand to `fish_config`: - `fish_config prompt list` shows all the available prompt names - `fish_config prompt show` demos the available sample prompts - `fish_config prompt choose` sources a prompt - `fish_config prompt save` makes the choice permanent A bare `fish_config` or `fish_config browse` opens the web UI. Part of #3625. TODO: This shows the right prompt on a new line. Showing it in-line is awkward to do because we'd have to move it to the right.
15 lines
1.0 KiB
Fish
15 lines
1.0 KiB
Fish
complete fish_config -f
|
|
set -l prompt_commands choose save show list
|
|
complete fish_config -n '__fish_use_subcommand' -a prompt -d 'View and pick from the sample prompts'
|
|
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
|
|
-a choose -d 'View and pick from the sample prompts'
|
|
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
|
|
-a show -d 'Show what prompts would look like'
|
|
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
|
|
-a list -d 'List all available prompts'
|
|
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
|
|
-a save -d 'Save the current or given prompt to ~/.config/fish'
|
|
complete fish_config -n '__fish_seen_subcommand_from prompt; and __fish_seen_subcommand_from choose save show' -a '(prompt list)'
|
|
|
|
complete fish_config -n '__fish_use_subcommand' -a browse -d 'Open the web-based UI'
|