aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/fish_vi_mode.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-06-04 13:31:48 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-06-14 11:36:11 -0700
commit767742c7e7ee53c8aa7950f928d551c63d69448f (patch)
tree600a9090d1c5dd699170bf2b348e551c2f2f6287 /share/functions/fish_vi_mode.fish
parent0ddd0ed4fbee08429c215946ca4dd19cd3e56a63 (diff)
Rework how the mode is reported in fish_vi_mode
Add a new function fish_mode_prompt which (if it is defined) has its output prepended to the left prompt. Rather than replacing the prompt wholesale, make fish_vi_mode enable this function by setting a variable __fish_vi_mode. This enables vi mode to interoperate nicely with custom prompts. Users who want to change how the mode is reported can either redefine this function or erase it entirely. Fixes #1988.
Diffstat (limited to 'share/functions/fish_vi_mode.fish')
-rw-r--r--share/functions/fish_vi_mode.fish8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/functions/fish_vi_mode.fish b/share/functions/fish_vi_mode.fish
index e431d0e4..b4fbe63a 100644
--- a/share/functions/fish_vi_mode.fish
+++ b/share/functions/fish_vi_mode.fish
@@ -1,6 +1,8 @@
function fish_vi_mode
- function fish_prompt
- fish_vi_prompt
- end
+ # Set the __fish_vi_mode variable
+ # This triggers fish_mode_prompt to output the mode indicator
+ set -g __fish_vi_mode 1
+
+ # Turn on vi keybindings
set -g fish_key_bindings fish_vi_key_bindings
end