mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 06:31:13 -03:00
Add backspace bindings to vi-mode
This was erroneously omitted from the previous commit. Now backspace in insert mode does backward-delete-char, in default mode backward-char (i.e. no deleting, just moving). This is consistent with vim.
This commit is contained in:
@@ -1058,12 +1058,16 @@ Command mode is also known as normal mode.
|
||||
- @key{Control, X} copies the current buffer to the system's clipboard, @key{Control, V} inserts the clipboard contents.
|
||||
- @key{Control,C} deletes the entire line.
|
||||
|
||||
- @key{Backspace} moves the cursor left.
|
||||
|
||||
\subsubsection vi-mode-insert Insert mode
|
||||
|
||||
- @key{Escape} or @key{Control,C} enters <a href="#vi-mode-command">command mode</a>.
|
||||
|
||||
- @key{Control,x} moves the cursor to the end of the line. If an autosuggestion is available, it will be accepted completely.
|
||||
|
||||
- @key{Backspace} removes one character to the left.
|
||||
|
||||
\subsubsection vi-mode-visual Visual mode
|
||||
|
||||
- @cursor_key{←,Left} and @cursor_key{→,Right} extend the selection backward/forward by one character.
|
||||
|
||||
@@ -97,8 +97,11 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||
|
||||
bind -k dc delete-char
|
||||
|
||||
bind -k backspace backward-delete-char
|
||||
bind \x7f backward-delete-char
|
||||
# Backspace deletes a char in insert mode, but not in normal/default mode.
|
||||
bind -M insert -k backspace backward-delete-char
|
||||
bind -M default -k backspace backward-char
|
||||
bind -M insert \x7f backward-delete-char
|
||||
bind -M default \x7f backward-char
|
||||
bind \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-delete
|
||||
|
||||
bind dd kill-whole-line
|
||||
|
||||
Reference in New Issue
Block a user