mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 03:13:37 +08:00
Allow setting key bindings universally
As always, we default to setting globally.
This commit is contained in:
parent
e67505bead
commit
daa217f533
|
@ -2,7 +2,9 @@
|
|||
function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fish"
|
||||
if not set -q argv[1]
|
||||
if test "$fish_key_bindings" != "fish_default_key_bindings"
|
||||
set -g fish_key_bindings fish_default_key_bindings # This triggers the handler, which calls us again and ensures the user_key_bindings are executed
|
||||
# Allow the user to set the variable universally
|
||||
set -q fish_key_bindings; or set -g fish_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
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
if test "$fish_key_bindings" != "fish_vi_key_bindings"
|
||||
set -g fish_key_bindings fish_vi_key_bindings # This triggers the handler, which calls us again and ensures the user_key_bindings are executed
|
||||
# Allow the user to set the variable universally
|
||||
set -q fish_key_bindings; or set -g fish_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
|
||||
|
|
Loading…
Reference in New Issue
Block a user