mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 01:52:39 +08:00
767742c7e7
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.
9 lines
230 B
Fish
9 lines
230 B
Fish
function fish_vi_mode
|
|
# 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
|