mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:06:49 +08:00
fish_vi_key_bindings: add 'ab' and 'ib' vi text object
Part of #1842 The implementation is obviously isn't 100% vi compatible, but works good enough for major cases This commit depends on previous commits where jump-{to, till}-matching-bracket motions were introduces
This commit is contained in:
parent
67e190876a
commit
e03e5e116d
|
@ -182,6 +182,7 @@ New or improved bindings
|
||||||
- Added bindings for clipboard interaction, like :kbd:`",+,p` and :kbd:`",+,y,y`.
|
- Added bindings for clipboard interaction, like :kbd:`",+,p` and :kbd:`",+,y,y`.
|
||||||
- Deleting in visual mode now moves the cursor back, matching vi (:issue:`10394`).
|
- Deleting in visual mode now moves the cursor back, matching vi (:issue:`10394`).
|
||||||
- Support :kbd:`%` motion.
|
- Support :kbd:`%` motion.
|
||||||
|
- Support `ab` and `ib` vi text objects. New input functions are introduced ``jump-{to,till}-matching-bracket`` (:issue:`1842`).
|
||||||
|
|
||||||
Completions
|
Completions
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
|
@ -169,6 +169,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||||
bind -s --preset d,T begin-selection backward-jump forward-single-char kill-selection end-selection
|
bind -s --preset d,T begin-selection backward-jump forward-single-char kill-selection end-selection
|
||||||
bind -s --preset d,h backward-char delete-char
|
bind -s --preset d,h backward-char delete-char
|
||||||
bind -s --preset d,l delete-char
|
bind -s --preset d,l delete-char
|
||||||
|
bind -s --preset d,i,b jump-till-matching-bracket and jump-till-matching-bracket and begin-selection jump-till-matching-bracket kill-selection end-selection
|
||||||
|
bind -s --preset d,a,b jump-to-matching-bracket and jump-to-matching-bracket and begin-selection jump-to-matching-bracket kill-selection end-selection
|
||||||
bind -s --preset d,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection
|
bind -s --preset d,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection
|
||||||
bind -s --preset d,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection
|
bind -s --preset d,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection
|
||||||
bind -s --preset 'd,;' begin-selection repeat-jump kill-selection end-selection
|
bind -s --preset 'd,;' begin-selection repeat-jump kill-selection end-selection
|
||||||
|
@ -199,6 +201,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||||
bind -s --preset -m insert c,T begin-selection backward-jump forward-single-char kill-selection end-selection repaint-mode
|
bind -s --preset -m insert c,T begin-selection backward-jump forward-single-char kill-selection end-selection repaint-mode
|
||||||
bind -s --preset -m insert c,h backward-char begin-selection kill-selection end-selection repaint-mode
|
bind -s --preset -m insert c,h backward-char begin-selection kill-selection end-selection repaint-mode
|
||||||
bind -s --preset -m insert c,l begin-selection kill-selection end-selection repaint-mode
|
bind -s --preset -m insert c,l begin-selection kill-selection end-selection repaint-mode
|
||||||
|
bind -s --preset -m insert c,i,b jump-till-matching-bracket and jump-till-matching-bracket and begin-selection jump-till-matching-bracket kill-selection end-selection
|
||||||
|
bind -s --preset -m insert c,a,b jump-to-matching-bracket and jump-to-matching-bracket and begin-selection jump-to-matching-bracket kill-selection end-selection
|
||||||
bind -s --preset -m insert c,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode
|
bind -s --preset -m insert c,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode
|
||||||
bind -s --preset -m insert c,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode
|
bind -s --preset -m insert c,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection end-selection repaint-mode
|
||||||
|
|
||||||
|
@ -235,6 +239,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
||||||
bind -s --preset y,T begin-selection backward-jump-till kill-selection yank end-selection
|
bind -s --preset y,T begin-selection backward-jump-till kill-selection yank end-selection
|
||||||
bind -s --preset y,h backward-char begin-selection kill-selection yank end-selection
|
bind -s --preset y,h backward-char begin-selection kill-selection yank end-selection
|
||||||
bind -s --preset y,l begin-selection kill-selection yank end-selection
|
bind -s --preset y,l begin-selection kill-selection yank end-selection
|
||||||
|
bind -s --preset y,i,b jump-till-matching-bracket and jump-till-matching-bracket and begin-selection jump-till-matching-bracket kill-selection yank end-selection
|
||||||
|
bind -s --preset y,a,b jump-to-matching-bracket and jump-to-matching-bracket and begin-selection jump-to-matching-bracket kill-selection yank end-selection
|
||||||
bind -s --preset y,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection yank end-selection
|
bind -s --preset y,i backward-jump-till and repeat-jump-reverse and begin-selection repeat-jump kill-selection yank end-selection
|
||||||
bind -s --preset y,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection yank end-selection
|
bind -s --preset y,a backward-jump and repeat-jump-reverse and begin-selection repeat-jump kill-selection yank end-selection
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user