aboutsummaryrefslogtreecommitdiff
path: root/fish/functions/fish_mode_prompt.fish
diff options
context:
space:
mode:
Diffstat (limited to 'fish/functions/fish_mode_prompt.fish')
-rw-r--r--fish/functions/fish_mode_prompt.fish21
1 files changed, 21 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..c32b5f8
--- /dev/null
+++ b/fish/functions/fish_mode_prompt.fish
@@ -0,0 +1,21 @@
+function fish_mode_prompt
+ if test "$fish_key_bindings" != fish_default_key_bindings
+ set --local vi_mode_color
+ set --local vi_mode_symbol
+ switch $fish_bind_mode
+ case default
+ set vi_mode_color (set_color $fish_color_selection)
+ set vi_mode_symbol N
+ case insert
+ set vi_mode_color (set_color $fish_color_selection)
+ set vi_mode_symbol I
+ case replace replace_one
+ set vi_mode_color (set_color $fish_color_match)
+ set vi_mode_symbol R
+ case visual
+ set vi_mode_color (set_color $fish_color_match)
+ set vi_mode_symbol V
+ end
+ echo -e -n "$vi_mode_color $vi_mode_symbol \x1b[0m "
+ end
+end