diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-06-13 15:59:03 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-06-13 15:59:03 +0200 |
| commit | ef9e297ee7cec55b3d2ee2eeae63f466206e1a24 (patch) | |
| tree | 1fe10b5484982ae855f70a767961bfc025b8ab67 /fish | |
| parent | 502a762ab860f6befa40e8503dd69ea712a86a94 (diff) | |
| download | dots-ef9e297ee7cec55b3d2ee2eeae63f466206e1a24.tar.gz | |
Add first dump of fish config files
Diffstat (limited to 'fish')
| -rw-r--r-- | fish/.gitignore | 2 | ||||
| -rw-r--r-- | fish/completions/bat.fish | 245 | ||||
| -rw-r--r-- | fish/completions/fisher.fish | 7 | ||||
| -rw-r--r-- | fish/completions/rg.fish | 175 | ||||
| -rw-r--r-- | fish/conf.d/fzf.fish | 1 | ||||
| -rw-r--r-- | fish/config.fish | 6 | ||||
| -rw-r--r-- | fish/fish_plugins | 2 | ||||
| -rw-r--r-- | fish/functions/__bobthefish_colors.fish | 1102 | ||||
| -rw-r--r-- | fish/functions/__bobthefish_display_colors.fish | 3 | ||||
| -rw-r--r-- | fish/functions/__bobthefish_glyphs.fish | 104 | ||||
| -rw-r--r-- | fish/functions/bobthefish_display_colors.fish | 170 | ||||
| -rw-r--r-- | fish/functions/fish_greeting.fish | 9 | ||||
| -rw-r--r-- | fish/functions/fish_mode_prompt.fish | 42 | ||||
| -rw-r--r-- | fish/functions/fish_prompt.fish | 1338 | ||||
| -rw-r--r-- | fish/functions/fish_right_prompt.fish | 80 | ||||
| -rw-r--r-- | fish/functions/fish_title.fish | 30 | ||||
| -rw-r--r-- | fish/functions/fisher.fish | 240 | ||||
| -rw-r--r-- | fish/functions/m.fish | 4 | ||||
| -rw-r--r-- | fish/functions/state.fish | 4 |
19 files changed, 3564 insertions, 0 deletions
diff --git a/fish/.gitignore b/fish/.gitignore new file mode 100644 index 0000000..ee8ccf3 --- /dev/null +++ b/fish/.gitignore @@ -0,0 +1,2 @@ +fish_variables +functions/kara.fish diff --git a/fish/completions/bat.fish b/fish/completions/bat.fish new file mode 100644 index 0000000..a6e2d96 --- /dev/null +++ b/fish/completions/bat.fish @@ -0,0 +1,245 @@ +# Fish Shell Completions +# Copy or symlink to $XDG_CONFIG_HOME/fish/completions/bat.fish +# ($XDG_CONFIG_HOME is usually set to ~/.config) + +# `bat` is `batcat` on Debian and Ubuntu +set bat bat + +# Helper functions: + +function __bat_complete_files -a token + # Cheat to complete files by calling `complete -C` on a fake command name, + # like `__fish_complete_directories` does. + set -l fake_command aaabccccdeeeeefffffffffgghhhhhhiiiii + complete -C"$fake_command $token" +end + +function __bat_complete_one_language -a comp + command $bat --list-languages | string split -f1 : | string match -e "$comp" +end + +function __bat_complete_list_languages + for spec in (command $bat --list-languages) + set -l name (string split -f1 : $spec) + for ext in (string split -f2 : $spec | string split ,) + test -n "$ext"; or continue + string match -rq '[/*]' $ext; and continue + printf "%s\t%s\n" $ext $name + end + printf "%s\t\n" $name + end +end + +function __bat_complete_map_syntax + set -l token (commandline -ct) + + if string match -qr '(?<glob>.+):(?<syntax>.*)' -- $token + # If token ends with a colon, complete with the list of language names. + set -f comps $glob:(__bat_complete_one_language $syntax) + else if string match -qr '\*' -- $token + # If token contains a globbing character (`*`), complete only possible + # globs in the current directory + set -f comps (__bat_complete_files $token | string match -er '[*]'): + else + # Complete files (and globs). + set -f comps (__bat_complete_files $token | string match -erv '/$'): + end + + if set -q comps[1] + printf "%s\t\n" $comps + end +end + +function __bat_cache_subcommand + __fish_seen_subcommand_from cache +end + +# Returns true if no exclusive arguments seen. +function __bat_no_excl_args + not __bat_cache_subcommand; and not __fish_seen_argument \ + -s h -l help \ + -s V -l version \ + -l acknowledgements \ + -l config-dir -l config-file \ + -l diagnostic \ + -l list-languages -l list-themes +end + +# Returns true if the 'cache' subcommand is seen without any exclusive arguments. +function __bat_cache_no_excl + __bat_cache_subcommand; and not __fish_seen_argument \ + -s h -l help \ + -l acknowledgements -l build -l clear +end + +function __bat_style_opts + set -l style_opts \ + "default,recommended components" \ + "auto,same as 'default' unless piped" \ + "full,all components" \ + "plain,no components" \ + "changes,Git change markers" \ + "header,alias for header-filename" \ + "header-filename,filename above content" \ + "header-filesize,filesize above content" \ + "grid,lines b/w sidebar/header/content" \ + "numbers,line numbers in sidebar" \ + "rule,separate files" \ + "snip,separate ranges" + + string replace , \t $style_opts +end + +# Use option argument descriptions to indicate which is the default, saving +# horizontal space and making sure the option description isn't truncated. +set -l color_opts ' + auto\tdefault + never\t + always\t +' +set -l decorations_opts $color_opts +set -l paging_opts $color_opts + +# Include some examples so we can indicate the default. +set -l pager_opts ' + less\tdefault + less\ -FR\t + more\t + vimpager\t +' + +set -l italic_text_opts ' + always\t + never\tdefault +' + +set -l wrap_opts ' + auto\tdefault + never\t + character\t +' + +# While --tabs theoretically takes any number, most people should be OK with these. +# Specifying a list lets us explain what 0 does. +set -l tabs_opts ' + 0\tpass\ tabs\ through\ directly + 1\t + 2\t + 4\t + 8\t +' + +set -l special_themes ' + auto\tdefault,\ Choose\ a\ theme\ based\ on\ dark\ or\ light\ mode + auto:always\tChoose\ a\ theme\ based\ on\ dark\ or\ light\ mode + auto:system\tChoose\ a\ theme\ based\ on\ dark\ or\ light\ mode + dark\tUse\ the\ theme\ specified\ by\ --theme-dark + light\tUse\ the\ theme\ specified\ by\ --theme-light +' + +# Completions: + +complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg + +complete -c $bat -l cache-dir -f -d "Show bat's cache directory" -n __fish_is_first_arg + +complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args + +complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg + +complete -c $bat -l config-file -f -d "Display location of configuration file" -n __fish_is_first_arg + +complete -c $bat -l decorations -x -a "$decorations_opts" -d "When to use --style decorations" -n __bat_no_excl_args + +complete -c $bat -l diagnostic -d "Print diagnostic info for bug reports" -n __fish_is_first_arg + +complete -c $bat -s d -l diff -d "Only show lines with Git changes" -n __bat_no_excl_args + +complete -c $bat -l diff-context -x -d "Show N context lines around Git changes" -n "__fish_seen_argument -s d -l diff" + +complete -c $bat -l generate-config-file -f -d "Generates a default configuration file" -n __fish_is_first_arg + +complete -c $bat -l file-name -x -d "Specify the display name" -n __bat_no_excl_args + +complete -c $bat -s f -l force-colorization -d "Force color and decorations" -n __bat_no_excl_args + +complete -c $bat -s h -d "Print a concise overview" -n __fish_is_first_arg + +complete -c $bat -l help -f -d "Print all help information" -n __fish_is_first_arg + +complete -c $bat -s H -l highlight-line -x -d "Highlight line(s) N[:M]" -n __bat_no_excl_args + +complete -c $bat -l ignored-suffix -x -d "Ignore extension" -n __bat_no_excl_args + +complete -c $bat -l italic-text -x -a "$italic_text_opts" -d "When to use italic text in the output" -n __bat_no_excl_args + +complete -c $bat -s l -l language -x -k -a "(__bat_complete_list_languages)" -d "Set the syntax highlighting language" -n __bat_no_excl_args + +complete -c $bat -l lessopen -d "Enable the $LESSOPEN preprocessor" -n __fish_is_first_arg + +complete -c $bat -s r -l line-range -x -d "Only print lines [M]:[N] (either optional)" -n __bat_no_excl_args + +complete -c $bat -l list-languages -f -d "List syntax highlighting languages" -n __fish_is_first_arg + +complete -c $bat -l list-themes -f -d "List syntax highlighting themes" -n __fish_is_first_arg + +complete -c $bat -s m -l map-syntax -x -a "(__bat_complete_map_syntax)" -d "Map <glob pattern>:<language syntax>" -n __bat_no_excl_args + +complete -c $bat -l no-config -d "Do not use the configuration file" + +complete -c $bat -l no-custom-assets -d "Do not load custom assets" + +complete -c $bat -l no-lessopen -d "Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)" + +complete -c $bat -s n -l number -d "Only show line numbers, no other decorations" -n __bat_no_excl_args + +complete -c $bat -l pager -x -a "$pager_opts" -d "Which pager to use" -n __bat_no_excl_args + +complete -c $bat -l paging -x -a "$paging_opts" -d "When to use the pager" -n __bat_no_excl_args + +complete -c $bat -s p -l plain -d "Disable decorations" -n __bat_no_excl_args + +complete -c $bat -o pp -d "Disable decorations and paging" -n __bat_no_excl_args + +complete -c $bat -s P -d "Disable paging" -n __bat_no_excl_args + +complete -c $bat -s A -l show-all -d "Show non-printable characters" -n __bat_no_excl_args + +complete -c $bat -l style -x -k -a "(__fish_complete_list , __bat_style_opts)" -d "Specify which non-content elements to display" -n __bat_no_excl_args + +complete -c $bat -l tabs -x -a "$tabs_opts" -d "Set tab width" -n __bat_no_excl_args + +complete -c $bat -l terminal-width -x -d "Set terminal <width>, +<offset>, or -<offset>" -n __bat_no_excl_args + +complete -c $bat -l theme -x -a "$special_themes(command $bat --list-themes | command cat)" -d "Set the syntax highlighting theme" -n __bat_no_excl_args + +complete -c $bat -l theme-dark -x -a "(command $bat --list-themes | command cat)" -d "Set the syntax highlighting theme for dark backgrounds" -n __bat_no_excl_args + +complete -c $bat -l theme-light -x -a "(command $bat --list-themes | command cat)" -d "Set the syntax highlighting theme for light backgrounds" -n __bat_no_excl_args + +complete -c $bat -s V -l version -f -d "Show version information" -n __fish_is_first_arg + +complete -c $bat -l wrap -x -a "$wrap_opts" -d "Text-wrapping mode" -n __bat_no_excl_args + +# Sub-command 'cache' completions +## Completion of the 'cache' command itself is removed for better UX +## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 + +complete -c $bat -l build -f -d "Parse new definitions into cache" -n __bat_cache_no_excl + +complete -c $bat -l clear -f -d "Reset definitions to defaults" -n __bat_cache_no_excl + +complete -c $bat -l blank -f -d "Create new data instead of appending" -n "__bat_cache_subcommand; and not __fish_seen_argument -l clear" + +complete -c $bat -l source -x -a "(__fish_complete_directories)" -d "Load syntaxes and themes from DIR" -n "__bat_cache_subcommand; and not __fish_seen_argument -l clear" + +complete -c $bat -l target -x -a "(__fish_complete_directories)" -d "Store cache in DIR" -n __bat_cache_subcommand + +complete -c $bat -l acknowledgements -d "Build acknowledgements.bin" -n __bat_cache_no_excl + +complete -c $bat -s h -d "Print a concise overview of $bat-cache help" -n __bat_cache_no_excl + +complete -c $bat -l help -f -d "Print all $bat-cache help" -n __bat_cache_no_excl + +# vim:ft=fish + diff --git a/fish/completions/fisher.fish b/fish/completions/fisher.fish new file mode 100644 index 0000000..6d23ce4 --- /dev/null +++ b/fish/completions/fisher.fish @@ -0,0 +1,7 @@ +complete --command fisher --exclusive --long help --description "Print help" +complete --command fisher --exclusive --long version --description "Print version" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" +complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" diff --git a/fish/completions/rg.fish b/fish/completions/rg.fish new file mode 100644 index 0000000..687931e --- /dev/null +++ b/fish/completions/rg.fish @@ -0,0 +1,175 @@ +complete -c rg -s e -l regexp -d 'A pattern to search for.' -r -f +complete -c rg -s f -l file -d 'Search for patterns from the given file.' -r -F +complete -c rg -s A -l after-context -d 'Show NUM lines after each match.' -r -f +complete -c rg -s B -l before-context -d 'Show NUM lines before each match.' -r -f +complete -c rg -l binary -d 'Search binary files.' +complete -c rg -l no-binary -n '__fish_contains_opt binary' -d 'Search binary files.' +complete -c rg -l block-buffered -d 'Force block buffering.' +complete -c rg -l no-block-buffered -n '__fish_contains_opt block-buffered' -d 'Force block buffering.' +complete -c rg -s b -l byte-offset -d 'Print the byte offset for each matching line.' +complete -c rg -l no-byte-offset -n '__fish_contains_opt -s b byte-offset' -d 'Print the byte offset for each matching line.' +complete -c rg -s s -l case-sensitive -d 'Search case sensitively (default).' +complete -c rg -l color -d 'When to use color.' -r -f -a 'never auto always ansi' +complete -c rg -l colors -d 'Configure color settings and styles.' -r -f +complete -c rg -l column -d 'Show column numbers.' +complete -c rg -l no-column -n '__fish_contains_opt column' -d 'Show column numbers.' +complete -c rg -s C -l context -d 'Show NUM lines before and after each match.' -r -f +complete -c rg -l context-separator -d 'Set the separator for contextual chunks.' -r -f +complete -c rg -l no-context-separator -n '__fish_contains_opt context-separator' -d 'Set the separator for contextual chunks.' +complete -c rg -s c -l count -d 'Show count of matching lines for each file.' +complete -c rg -l count-matches -d 'Show count of every match for each file.' +complete -c rg -l crlf -d 'Use CRLF line terminators (nice for Windows).' +complete -c rg -l no-crlf -n '__fish_contains_opt crlf' -d 'Use CRLF line terminators (nice for Windows).' +complete -c rg -l debug -d 'Show debug messages.' +complete -c rg -l dfa-size-limit -d 'The upper size limit of the regex DFA.' -r -f +complete -c rg -s E -l encoding -d 'Specify the text encoding of files to search.' -r -f -a '# This is impossible to read, but these encodings rarely if ever change, so +# it probably does not matter. They are derived from the list given here: +# https://encoding.spec.whatwg.org/#concept-encoding-get +# +# The globbing here works in both fish and zsh (though they expand it in +# different orders). It may work in other shells too. + +{{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean} +logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian} +866 ibm{819,866} csibm866 +big5{,-hkscs} {cn-,cs}big5 x-x-big5 +cp{819,866,125{0,1,2,3,4,5,6,7,8}} x-cp125{0,1,2,3,4,5,6,7,8} +csiso2022{jp,kr} csiso8859{6,8}{e,i} +csisolatin{1,2,3,4,5,6,9} csisolatin{arabic,cyrillic,greek,hebrew} +ecma-{114,118} asmo-708 elot_928 sun_eu_greek +euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese +{,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312 +iso-2022-{cn,cn-ext,jp,kr} +iso8859{,-}{1,2,3,4,5,6,7,8,9,10,11,13,14,15} +iso-8859-{1,2,3,4,5,6,7,8,9,10,11,{6,8}-{e,i},13,14,15,16} iso_8859-{1,2,3,4,5,6,7,8,9,15} +iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989 +iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157} +koi{,8,8-r,8-ru,8-u,8_r} cskoi8r +ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987 +latin{1,2,3,4,5,6} l{1,2,3,4,5,6,9} +shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932 +utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8 +windows-{31j,874,949,125{0,1,2,3,4,5,6,7,8}} dos-874 tis-620 ansi_x3.4-1968 +x-user-defined auto none +' +complete -c rg -l no-encoding -n '__fish_contains_opt -s E encoding' -d 'Specify the text encoding of files to search.' +complete -c rg -l engine -d 'Specify which regex engine to use.' -r -f -a 'default pcre2 auto' +complete -c rg -l field-context-separator -d 'Set the field context separator.' -r -f +complete -c rg -l field-match-separator -d 'Set the field match separator.' -r -f +complete -c rg -l files -d 'Print each file that would be searched.' +complete -c rg -s l -l files-with-matches -d 'Print the paths with at least one match.' +complete -c rg -l files-without-match -d 'Print the paths that contain zero matches.' +complete -c rg -s F -l fixed-strings -d 'Treat all patterns as literals.' +complete -c rg -l no-fixed-strings -n '__fish_contains_opt -s F fixed-strings' -d 'Treat all patterns as literals.' +complete -c rg -s L -l follow -d 'Follow symbolic links.' +complete -c rg -l no-follow -n '__fish_contains_opt -s L follow' -d 'Follow symbolic links.' +complete -c rg -l generate -d 'Generate man pages and completion scripts.' -r -f -a 'man complete-bash complete-zsh complete-fish complete-powershell' +complete -c rg -s g -l glob -d 'Include or exclude file paths.' -r -f +complete -c rg -l glob-case-insensitive -d 'Process all glob patterns case insensitively.' +complete -c rg -l no-glob-case-insensitive -n '__fish_contains_opt glob-case-insensitive' -d 'Process all glob patterns case insensitively.' +complete -c rg -l heading -d 'Print matches grouped by each file.' +complete -c rg -l no-heading -n '__fish_contains_opt heading' -d 'Print matches grouped by each file.' +complete -c rg -s h -l help -d 'Show help output.' +complete -c rg -s . -l hidden -d 'Search hidden files and directories.' +complete -c rg -l no-hidden -n '__fish_contains_opt -s . hidden' -d 'Search hidden files and directories.' +complete -c rg -l hostname-bin -d 'Run a program to get this system\'s hostname.' -r -f -a '(__fish_complete_command)' +complete -c rg -l hyperlink-format -d 'Set the format of hyperlinks.' -r -f +complete -c rg -l iglob -d 'Include/exclude paths case insensitively.' -r -f +complete -c rg -s i -l ignore-case -d 'Case insensitive search.' +complete -c rg -l ignore-file -d 'Specify additional ignore files.' -r -F +complete -c rg -l ignore-file-case-insensitive -d 'Process ignore files case insensitively.' +complete -c rg -l no-ignore-file-case-insensitive -n '__fish_contains_opt ignore-file-case-insensitive' -d 'Process ignore files case insensitively.' +complete -c rg -l include-zero -d 'Include zero matches in summary output.' +complete -c rg -l no-include-zero -n '__fish_contains_opt include-zero' -d 'Include zero matches in summary output.' +complete -c rg -s v -l invert-match -d 'Invert matching.' +complete -c rg -l no-invert-match -n '__fish_contains_opt -s v invert-match' -d 'Invert matching.' +complete -c rg -l json -d 'Show search results in a JSON Lines format.' +complete -c rg -l no-json -n '__fish_contains_opt json' -d 'Show search results in a JSON Lines format.' +complete -c rg -l line-buffered -d 'Force line buffering.' +complete -c rg -l no-line-buffered -n '__fish_contains_opt line-buffered' -d 'Force line buffering.' +complete -c rg -s n -l line-number -d 'Show line numbers.' +complete -c rg -s N -l no-line-number -d 'Suppress line numbers.' +complete -c rg -s x -l line-regexp -d 'Show matches surrounded by line boundaries.' +complete -c rg -s M -l max-columns -d 'Omit lines longer than this limit.' -r -f +complete -c rg -l max-columns-preview -d 'Show preview for lines exceeding the limit.' +complete -c rg -l no-max-columns-preview -n '__fish_contains_opt max-columns-preview' -d 'Show preview for lines exceeding the limit.' +complete -c rg -s m -l max-count -d 'Limit the number of matching lines.' -r -f +complete -c rg -s d -l max-depth -d 'Descend at most NUM directories.' -r -f +complete -c rg -l max-filesize -d 'Ignore files larger than NUM in size.' -r -f +complete -c rg -l mmap -d 'Search with memory maps when possible.' +complete -c rg -l no-mmap -n '__fish_contains_opt mmap' -d 'Search with memory maps when possible.' +complete -c rg -s U -l multiline -d 'Enable searching across multiple lines.' +complete -c rg -l no-multiline -n '__fish_contains_opt -s U multiline' -d 'Enable searching across multiple lines.' +complete -c rg -l multiline-dotall -d 'Make \'.\' match line terminators.' +complete -c rg -l no-multiline-dotall -n '__fish_contains_opt multiline-dotall' -d 'Make \'.\' match line terminators.' +complete -c rg -l no-config -d 'Never read configuration files.' +complete -c rg -l no-ignore -d 'Don\'t use ignore files.' +complete -c rg -l ignore -n '__fish_contains_opt no-ignore' -d 'Don\'t use ignore files.' +complete -c rg -l no-ignore-dot -d 'Don\'t use .ignore or .rgignore files.' +complete -c rg -l ignore-dot -n '__fish_contains_opt no-ignore-dot' -d 'Don\'t use .ignore or .rgignore files.' +complete -c rg -l no-ignore-exclude -d 'Don\'t use local exclusion files.' +complete -c rg -l ignore-exclude -n '__fish_contains_opt no-ignore-exclude' -d 'Don\'t use local exclusion files.' +complete -c rg -l no-ignore-files -d 'Don\'t use --ignore-file arguments.' +complete -c rg -l ignore-files -n '__fish_contains_opt no-ignore-files' -d 'Don\'t use --ignore-file arguments.' +complete -c rg -l no-ignore-global -d 'Don\'t use global ignore files.' +complete -c rg -l ignore-global -n '__fish_contains_opt no-ignore-global' -d 'Don\'t use global ignore files.' +complete -c rg -l no-ignore-messages -d 'Suppress gitignore parse error messages.' +complete -c rg -l ignore-messages -n '__fish_contains_opt no-ignore-messages' -d 'Suppress gitignore parse error messages.' +complete -c rg -l no-ignore-parent -d 'Don\'t use ignore files in parent directories.' +complete -c rg -l ignore-parent -n '__fish_contains_opt no-ignore-parent' -d 'Don\'t use ignore files in parent directories.' +complete -c rg -l no-ignore-vcs -d 'Don\'t use ignore files from source control.' +complete -c rg -l ignore-vcs -n '__fish_contains_opt no-ignore-vcs' -d 'Don\'t use ignore files from source control.' +complete -c rg -l no-messages -d 'Suppress some error messages.' +complete -c rg -l messages -n '__fish_contains_opt no-messages' -d 'Suppress some error messages.' +complete -c rg -l no-require-git -d 'Use .gitignore outside of git repositories.' +complete -c rg -l require-git -n '__fish_contains_opt no-require-git' -d 'Use .gitignore outside of git repositories.' +complete -c rg -l no-unicode -d 'Disable Unicode mode.' +complete -c rg -l unicode -n '__fish_contains_opt no-unicode' -d 'Disable Unicode mode.' +complete -c rg -s 0 -l null -d 'Print a NUL byte after file paths.' +complete -c rg -l null-data -d 'Use NUL as a line terminator.' +complete -c rg -l one-file-system -d 'Skip directories on other file systems.' +complete -c rg -l no-one-file-system -n '__fish_contains_opt one-file-system' -d 'Skip directories on other file systems.' +complete -c rg -s o -l only-matching -d 'Print only matched parts of a line.' +complete -c rg -l path-separator -d 'Set the path separator for printing paths.' -r -f +complete -c rg -l passthru -d 'Print both matching and non-matching lines.' +complete -c rg -s P -l pcre2 -d 'Enable PCRE2 matching.' +complete -c rg -l no-pcre2 -n '__fish_contains_opt -s P pcre2' -d 'Enable PCRE2 matching.' +complete -c rg -l pcre2-version -d 'Print the version of PCRE2 that ripgrep uses.' +complete -c rg -l pre -d 'Search output of COMMAND for each PATH.' -r -f -a '(__fish_complete_command)' +complete -c rg -l no-pre -n '__fish_contains_opt pre' -d 'Search output of COMMAND for each PATH.' +complete -c rg -l pre-glob -d 'Include or exclude files from a preprocessor.' -r -f +complete -c rg -s p -l pretty -d 'Alias for colors, headings and line numbers.' +complete -c rg -s q -l quiet -d 'Do not print anything to stdout.' +complete -c rg -l regex-size-limit -d 'The size limit of the compiled regex.' -r -f +complete -c rg -s r -l replace -d 'Replace matches with the given text.' -r -f +complete -c rg -s z -l search-zip -d 'Search in compressed files.' +complete -c rg -l no-search-zip -n '__fish_contains_opt -s z search-zip' -d 'Search in compressed files.' +complete -c rg -s S -l smart-case -d 'Smart case search.' +complete -c rg -l sort -d 'Sort results in ascending order.' -r -f -a 'none path modified accessed created' +complete -c rg -l sortr -d 'Sort results in descending order.' -r -f -a 'none path modified accessed created' +complete -c rg -l stats -d 'Print statistics about the search.' +complete -c rg -l no-stats -n '__fish_contains_opt stats' -d 'Print statistics about the search.' +complete -c rg -l stop-on-nonmatch -d 'Stop searching after a non-match.' +complete -c rg -s a -l text -d 'Search binary files as if they were text.' +complete -c rg -l no-text -n '__fish_contains_opt -s a text' -d 'Search binary files as if they were text.' +complete -c rg -s j -l threads -d 'Set the approximate number of threads to use.' -r -f +complete -c rg -l trace -d 'Show trace messages.' +complete -c rg -l trim -d 'Trim prefix whitespace from matches.' +complete -c rg -l no-trim -n '__fish_contains_opt trim' -d 'Trim prefix whitespace from matches.' +complete -c rg -s t -l type -d 'Only search files matching TYPE.' -r -f -a '(rg --type-list | string replace : \t)' +complete -c rg -s T -l type-not -d 'Do not search files matching TYPE.' -r -f -a '(rg --type-list | string replace : \t)' +complete -c rg -l type-add -d 'Add a new glob for a file type.' -r -f +complete -c rg -l type-clear -d 'Clear globs for a file type.' -r -f +complete -c rg -l type-list -d 'Show all supported file types.' +complete -c rg -s u -l unrestricted -d 'Reduce the level of "smart" filtering.' +complete -c rg -s V -l version -d 'Print ripgrep\'s version.' +complete -c rg -l vimgrep -d 'Print results in a vim compatible format.' +complete -c rg -s H -l with-filename -d 'Print the file path with each matching line.' +complete -c rg -s I -l no-filename -d 'Never print the path with each matching line.' +complete -c rg -s w -l word-regexp -d 'Show matches surrounded by word boundaries.' +complete -c rg -l auto-hybrid-regex -d '(DEPRECATED) Use PCRE2 if appropriate.' +complete -c rg -l no-auto-hybrid-regex -n '__fish_contains_opt auto-hybrid-regex' -d '(DEPRECATED) Use PCRE2 if appropriate.' +complete -c rg -l no-pcre2-unicode -d '(DEPRECATED) Disable Unicode mode for PCRE2.' +complete -c rg -l pcre2-unicode -n '__fish_contains_opt no-pcre2-unicode' -d '(DEPRECATED) Disable Unicode mode for PCRE2.' +complete -c rg -l sort-files -d '(DEPRECATED) Sort results by file path.' +complete -c rg -l no-sort-files -n '__fish_contains_opt sort-files' -d '(DEPRECATED) Sort results by file path.' diff --git a/fish/conf.d/fzf.fish b/fish/conf.d/fzf.fish new file mode 100644 index 0000000..086cf45 --- /dev/null +++ b/fish/conf.d/fzf.fish @@ -0,0 +1 @@ +set -x FZF_DEFAULT_OPTS_FILE ~/.config/fzf/config diff --git a/fish/config.fish b/fish/config.fish index d714361..c940fe2 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -1,3 +1,9 @@ if status is-interactive # Commands to run in interactive sessions can go here + set -g default_user christoph + set -g fish_prompt_pwd_dir_length 0 + set -g theme_powerline_fonts no + set -g theme_nerd_fonts yes + set -g theme_newline_cursor yes + set -g theme_date_timezone Europe/Berlin end diff --git a/fish/fish_plugins b/fish/fish_plugins new file mode 100644 index 0000000..70035f7 --- /dev/null +++ b/fish/fish_plugins @@ -0,0 +1,2 @@ +jorgebucaran/fisher +oh-my-fish/theme-bobthefish diff --git a/fish/functions/__bobthefish_colors.fish b/fish/functions/__bobthefish_colors.fish new file mode 100644 index 0000000..34a5d16 --- /dev/null +++ b/fish/functions/__bobthefish_colors.fish @@ -0,0 +1,1102 @@ +function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthefish' + switch "$color_scheme" + case 'user' + __bobthefish_user_color_scheme_deprecated + return + + case 'terminal' 'terminal-dark*' + set -l colorfg black + [ "$color_scheme" = 'terminal-dark-white' ]; and set colorfg white + set -x color_initial_segment_exit white red --bold + set -x color_initial_segment_private white black + set -x color_initial_segment_su white green --bold + set -x color_initial_segment_jobs white blue --bold + + set -x color_path black white + set -x color_path_basename black white --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree black $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username white black --bold + set -x color_hostname white black + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal-light*' + set -l colorfg white + [ "$color_scheme" = 'terminal-light-black' ]; and set colorfg black + set -x color_initial_segment_exit black red --bold + set -x color_initial_segment_private black white + set -x color_initial_segment_su black green --bold + set -x color_initial_segment_jobs black blue --bold + + set -x color_path white black + set -x color_path_basename white black --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree white $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username black white --bold + set -x color_hostname black white + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal2' 'terminal2-dark*' + set -l colorfg black + [ "$color_scheme" = 'terminal2-dark-white' ]; and set colorfg white + set -x color_initial_segment_exit grey red --bold + set -x color_initial_segment_private grey black + set -x color_initial_segment_su grey green --bold + set -x color_initial_segment_jobs grey blue --bold + + set -x color_path brgrey white + set -x color_path_basename brgrey white --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree brgrey $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username brgrey white --bold + set -x color_hostname brgrey white + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'terminal2-light*' + set -l colorfg white + [ "$color_scheme" = 'terminal2-light-black' ]; and set colorfg black + set -x color_initial_segment_exit brgrey red --bold + set -x color_initial_segment_private brgrey black + set -x color_initial_segment_su brgrey green --bold + set -x color_initial_segment_jobs brgrey blue --bold + + set -x color_path grey black + set -x color_path_basename grey black --bold + set -x color_path_nowrite magenta $colorfg + set -x color_path_nowrite_basename magenta $colorfg --bold + + set -x color_repo green $colorfg + set -x color_repo_work_tree grey $colorfg --bold + set -x color_repo_dirty brred $colorfg + set -x color_repo_staged yellow $colorfg + + set -x color_vi_mode_default brblue $colorfg --bold + set -x color_vi_mode_insert brgreen $colorfg --bold + set -x color_vi_mode_visual bryellow $colorfg --bold + + set -x color_vagrant brcyan $colorfg + set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold + set -x color_username grey black --bold + set -x color_hostname grey black + set -x color_screen brgreen $colorfg --bold + set -x color_rvm brmagenta $colorfg --bold + set -x color_node brgreen $colorfg --bold + set -x color_virtualfish brblue $colorfg --bold + set -x color_virtualgo brblue $colorfg --bold + set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold + + case 'zenburn' + set -l grey 333333 # a bit darker than normal zenburn grey + set -l red CC9393 + set -l green 7F9F7F + set -l yellow E3CEAB + set -l orange DFAF8F + set -l blue 8CD0D3 + set -l white DCDCCC + + set -x color_initial_segment_exit $white $red --bold + set -x color_initial_segment_private $white $grey + set -x color_initial_segment_su $white $green --bold + set -x color_initial_segment_jobs $white $blue --bold + + set -x color_path $grey $white + set -x color_path_basename $grey $white --bold + set -x color_path_nowrite $grey $red + set -x color_path_nowrite_basename $grey $red --bold + + set -x color_repo $green $grey + set -x color_repo_work_tree $grey $grey --bold + set -x color_repo_dirty $red $grey + set -x color_repo_staged $yellow $grey + + set -x color_vi_mode_default $grey $yellow --bold + set -x color_vi_mode_insert $green $white --bold + set -x color_vi_mode_visual $yellow $grey --bold + + set -x color_vagrant $blue $green --bold + set -x color_k8s $green $white --bold + set -x color_aws_vault $blue $grey --bold + set -x color_aws_vault_expired $blue $red --bold + set -x color_username $grey $blue --bold + set -x color_hostname $grey $blue + set -x color_screen $green $grey --bold |