mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 14:24:35 +08:00
11a60c8374
I hate doing this but I am tired of touching a fish script as part of some change and having `make style` radically change it. Which makes editing fish scripts more painful than it needs to be. It is time to do a wholesale reformatting of these scripts to conform to the documented style as implemented by the `fish_indent` program.
19 lines
685 B
Fish
19 lines
685 B
Fish
function fish_hybrid_key_bindings --description "Vi-style bindings that inherit emacs-style bindings in all modes"
|
|
bind --erase --all # clear earlier bindings, if any
|
|
|
|
if test "$fish_key_bindings" != "fish_hybrid_key_bindings"
|
|
# Allow the user to set the variable universally
|
|
set -q fish_key_bindings
|
|
or set -g fish_key_bindings
|
|
# This triggers the handler, which calls us again and ensures the user_key_bindings
|
|
# are executed.
|
|
set fish_key_bindings fish_hybrid_key_bindings
|
|
return
|
|
end
|
|
|
|
for mode in default insert visual
|
|
fish_default_key_bindings -M $mode
|
|
end
|
|
fish_vi_key_bindings --no-erase
|
|
end
|