mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Escape in vi mode to end paging, but stay in insert mode
Change the escape key binding in insert mode (in vi key bindings) to check if we are in paging mode. If so, emit cancel and stay in insert mode. Otherwise perform the current behavior of switching back to default mode and adjusting the cursor. Fixes #2871
This commit is contained in:
parent
56161250de
commit
8a09c99f36
1 changed files with 3 additions and 1 deletions
|
@ -64,7 +64,9 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
|||
# Add way to kill current command line while in insert mode.
|
||||
bind -M insert \cc __fish_cancel_commandline
|
||||
# Add a way to switch from insert to normal (command) mode.
|
||||
bind -M insert -m default \e backward-char force-repaint
|
||||
# Note if we are paging, we want to stay in insert mode
|
||||
# See #2871
|
||||
bind -M insert \e "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
|
||||
|
||||
# Default (command) mode
|
||||
bind :q exit
|
||||
|
|
Loading…
Reference in a new issue