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/functions/fish_mode_prompt.fish | |
| parent | 502a762ab860f6befa40e8503dd69ea712a86a94 (diff) | |
| download | dots-ef9e297ee7cec55b3d2ee2eeae63f466206e1a24.tar.gz | |
Add first dump of fish config files
Diffstat (limited to 'fish/functions/fish_mode_prompt.fish')
| -rw-r--r-- | fish/functions/fish_mode_prompt.fish | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/fish/functions/fish_mode_prompt.fish b/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..e4b38e5 --- /dev/null +++ b/fish/functions/fish_mode_prompt.fish @@ -0,0 +1,42 @@ +# Display the current binding mode... if it's vi or vi-like. +# +# To always show the binding mode (regardless of current bindings): +# set -g theme_display_vi yes +# +# To never show: +# set -g theme_display_vi no + +function fish_mode_prompt -d 'bobthefish-optimized fish mode indicator' + [ "$theme_display_vi" != 'no' ] + or return + + [ "$fish_key_bindings" = 'fish_vi_key_bindings' \ + -o "$fish_key_bindings" = 'hybrid_bindings' \ + -o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \ + -o "$theme_display_vi" = 'yes' ] + or return + + __bobthefish_colors $theme_color_scheme + + type -q bobthefish_colors + and bobthefish_colors + + set_color normal # clear out anything bold or underline... + + switch $fish_bind_mode + case default + set_color -b $color_vi_mode_default + echo -n ' N ' + case insert + set_color -b $color_vi_mode_insert + echo -n ' I ' + case replace replace_one replace-one + set_color -b $color_vi_mode_insert + echo -n ' R ' + case visual + set_color -b $color_vi_mode_visual + echo -n ' V ' + end + + set_color normal +end |