mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Let the binding functions set the binding variable
This ensures they can just be called and "the right thing" will happen - fish_user_key_bindings will be executed, the variable will reflect the bindings.
This commit is contained in:
parent
8ab980b793
commit
f5241da836
2 changed files with 8 additions and 0 deletions
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fish" -a mode
|
function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fish" -a mode
|
||||||
if not set -q mode[1]
|
if not set -q mode[1]
|
||||||
|
if test "$fish_key_bindings" != "fish_default_key_bindings"
|
||||||
|
set fish_key_bindings fish_default_key_bindings # This triggers the handler, which calls us again and ensures the user_key_bindings are executed
|
||||||
|
return
|
||||||
|
end
|
||||||
# Clear earlier bindings, if any
|
# Clear earlier bindings, if any
|
||||||
bind --erase --all
|
bind --erase --all
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||||
|
if test "$fish_key_bindings" != "fish_vi_key_bindings"
|
||||||
|
set fish_key_bindings fish_vi_key_bindings # This triggers the handler, which calls us again and ensures the user_key_bindings are executed
|
||||||
|
return
|
||||||
|
end
|
||||||
# The default escape timeout is 300ms. But for users of Vi bindings that can
|
# The default escape timeout is 300ms. But for users of Vi bindings that can
|
||||||
# be slightly annoying when trying to switch to Vi "normal" mode. Too,
|
# be slightly annoying when trying to switch to Vi "normal" mode. Too,
|
||||||
# vi-mode users are unlikely to use escape-as-meta. So set a much shorter
|
# vi-mode users are unlikely to use escape-as-meta. So set a much shorter
|
||||||
|
|
Loading…
Reference in a new issue