mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 11:22:52 +08:00
Vi mode: don't cross newline on escape
This commit is contained in:
parent
54b8817937
commit
25db4e803c
|
@ -56,7 +56,17 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
|||
# Add a way to switch from insert to normal (command) mode.
|
||||
# Note if we are paging, we want to stay in insert mode
|
||||
# See #2871
|
||||
bind -s --preset -M insert \e "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char repaint-mode; end"
|
||||
bind -s --preset -M insert \e '
|
||||
if commandline -P
|
||||
commandline -f cancel
|
||||
else
|
||||
set fish_bind_mode default
|
||||
if test (count (commandline --cut-at-cursor | tail -c2)) != 2
|
||||
commandline -f backward-char
|
||||
end
|
||||
commandline -f repaint-mode
|
||||
end
|
||||
'
|
||||
|
||||
# Default (command) mode
|
||||
bind -s --preset :q exit
|
||||
|
|
Loading…
Reference in New Issue
Block a user