@@ -1,54 +1,60 @@
1−# Fish Shell Completions (WIP)
1+# Fish Shell Completions
3# Place or symlink to $XDG_CONFIG_HOME/fish/completions/bat.fish ($XDG_CONFIG_HOME is usually set to ~/.config)
3# Place or symlink to $XDG_CONFIG_HOME/fish/completions/bat.fish ($XDG_CONFIG_HOME is usually set to ~/.config)
4−complete -c bat -s l -l language -d "Set the language for syntax highlighting"
6−complete -c bat -l list-languages -d "Display list of supported languages for syntax highlighting"
5+complete -c bat -l color -xka "auto never always" -d "Specify when to use colored output (default: auto)" -n "not __fish_seen_subcommand_from cache"
8−complete -c bat -s m -l map-syntax -d "<from:to> Map a file extension or file name to an existing syntax"
7+complete -c bat -l config-dir -d "Display location of 'bat' configuration directory" -n "not __fish_seen_subcommand_from cache"
10−# TODO: add completion for theme list
9+complete -c bat -l config-file -d "Display location of 'bat' configuration file" -n "not __fish_seen_subcommand_from cache"
11−complete -c bat -l theme -d "<theme> Set the theme for syntax highlighting"
13−complete -c bat -l list-themes -d "Display a list of supported themes for syntax highlighting"
11+complete -c bat -l decorations -xka "auto never always" -d "Specify when to use the decorations specified with '--style' (default: auto)" -n "not __fish_seen_subcommand_from cache"
15−# TODO: add completion for style list
13+complete -c bat -s h -l help -d "Print help message" -n "not __fish_seen_subcommand_from cache"
16−complete -c bat -l style -d "<styles> Comma-separated list of style elements or presets to display with file contents" -a 'auto full plain changes header grid numbers'
18−complete -c bat -s p -l plain -d "Only show plain style, no decorations. Alias for '--style=plain'"
15+complete -c bat -s H -l highlight-line -x -d "<N> Highlight the N-th line with a different background color" -n "not __fish_seen_subcommand_from cache"
20−complete -c bat -s n -l number -d "Only show line numbers, no other decorations. Alias for '--style=numbers'"
17+complete -c bat -l italic-text -xka "always never" -d "Specify when to use ANSI sequences for italic text (default: never)" -n "not __fish_seen_subcommand_from cache"
22−complete -c bat -s A -l show-all -d "Show non-printable characters like space/tab/newline"
19+# TODO: add parameter completion for available languages using option: -xka "(bat --list-languages | cat)"
20+# but replace 'cat' with some sed/awk like command that only outputs lines of valid options for this flag
21+complete -c bat -s l -l language -d "Set the language for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
24−# TODO: possibly add completion showing max line (using 'wc -l') on file in current arguments (using commandline -opc)
25−complete -c bat -s r -l line-range -d "<N:M> Only print the specified range of lines for each file"
23+complete -c bat -s r -l line-range -x -d "<N:M> Only print the specified range of lines for each file" -n "not __fish_seen_subcommand_from cache"
27−# TODO: possibly add completion showing max line (using 'wc -l') on file in current arguments (using commandline -opc)
25+complete -c bat -l list-languages -d "Display list of supported languages for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
28−complete -c bat -s H -l highlight-line -d "<N> Highlight the N-th line with a different background color"
30−complete -c bat -l color -xa 'auto never always' -d "<when> Specify when to use colored output (*auto*, never, always)"
27+complete -c bat -l list-themes -d "Display a list of supported themes for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
32−complete -c bat -l italic-text -xa 'always never' -d "<when> Specify when to use ANSI sequences for italic text (always, *never*)"
29+complete -c bat -s m -l map-syntax -x -d "<from:to> Map a file extension or file name to an existing syntax" -n "not __fish_seen_subcommand_from cache"
34−complete -c bat -l decorations -xa 'auto never always' -d "<when> Specify when to use the decorations specified with '--style' (*auto*, never, always)"
31+complete -c bat -s n -l number -d "Only show line numbers, no other decorations. Alias for '--style=numbers'" -n "not __fish_seen_subcommand_from cache"
36−complete -c bat -l paging -xa 'auto never always' -d "<when> Specify when to use the pager (*auto*, never, always)"
33+complete -c bat -l pager -x -d "<command> Specify which pager program to use (default: less)" -n "not __fish_seen_subcommand_from cache"
38−# TODO: add completion for sub-commands like less
35+complete -c bat -l paging -xka "auto never always" -d "Specify when to use the pager (default: auto)" -n "not __fish_seen_subcommand_from cache"
39−complete -c bat -l pager -d "<command> Specify which pager to use (default is 'less') eg. 'less -RF'"
41−complete -c bat -l wrap -xa 'auto never character' -d "<mode> Specify the text-wrapping mode (*auto*, never, character)"
37+complete -c bat -s p -l plain -d "Only show plain style, no decorations. Alias for '--style=plain'" -n "not __fish_seen_subcommand_from cache"
43−complete -c bat -l tabs -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)"
39+complete -c bat -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
45−complete -c bat -s u -l unbuffered -d "POSIX-compliant unbuffered output. Option is ignored"
41+complete -c bat -l style -xka "auto full plain changes header grid numbers" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
47−complete -c bat -l terminal-width -d "<width> Explicitly set terminal width; Prefix with '+' or '-' to offset (default width is auto determined)"
43+complete -c bat -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
49−complete -c bat -s h -l help -d "Print help message"
45+complete -c bat -l terminal-width -x -d "<width> Explicitly set terminal width; Prefix with '+' or '-' to offset (default width is auto determined)" -n "not __fish_seen_subcommand_from cache"
51−complete -c bat -s V -l version -d "Show version information"
47+complete -c bat -l theme -xka "(bat --list-themes | cat)" -d "Set the theme for syntax highlighting" -n "not __fish_seen_subcommand_from cache"
53−# TODO: add completion for sub-command 'cache'
49+complete -c bat -s u -l unbuffered -d "POSIX-compliant unbuffered output. Option is ignored" -n "not __fish_seen_subcommand_from cache"
51+complete -c bat -s V -l version -d "Show version information" -n "not __fish_seen_subcommand_from cache"
53+complete -c bat -l wrap -xka "auto never character" -d "<mode> Specify the text-wrapping mode (default: auto)" -n "not __fish_seen_subcommand_from cache"
55+# Sub-command 'cache' completions
54−# # cache Modify the syntax-definition and theme cache
56+complete -c bat -a "cache" -d "Modify the syntax/language definition cache" -n "not __fish_seen_subcommand_from cache"
58+complete -c bat -l build -f -d "Parse syntaxes/language definitions into cache" -n "__fish_seen_subcommand_from cache"
60+complete -c bat -l clear -f -d "Reset syntaxes/language definitions to default settings" -n "__fish_seen_subcommand_from cache"