diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 12:10:22 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 13:21:50 +0200 |
| commit | b366f55f29af3775c055115572dd84873b1921e0 (patch) | |
| tree | b9c6a710997272d8b84238965e6f992abfbed42c /config.def.h | |
| parent | a19159c506577a168655afcd961381dd1f995610 (diff) | |
| download | vis-b366f55f29af3775c055115572dd84873b1921e0.tar.gz vis-b366f55f29af3775c055115572dd84873b1921e0.tar.xz | |
vis: use multiple cursor/selection infrastructure
This commits introduces the following keybindings, in normal mode:
CTRL-N select word the cursor is currently over, switch to visual mode
CTRL-P remove least recently added cursor
ESC if a selection is active, clear it.
Otherwise dispose all but the primary cursor.
In visual mode:
CTRL-N create new cursor and select next word matching current selection
CTRL-X clear (skip) current selection, but select next matching word
CTRL-P remove least recently added cursor
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index 4402cd0..859b3db 100644 --- a/config.def.h +++ b/config.def.h @@ -363,6 +363,8 @@ static KeyBinding vis_mode_normal[] = { { { CONTROL('K') }, cursors_new, { .i = -1 } }, { { CONTROL('J') }, cursors_new, { .i = +1 } }, { { CONTROL('A') }, cursors_align, { } }, + { { CONTROL('N') }, cursors_select, { } }, + { { CONTROL('P') }, cursors_remove, { } }, { { CONTROL('w'), NONE('n') }, cmd, { .s = "open" } }, { { CONTROL('w'), NONE('c') }, cmd, { .s = "q" } }, { { CONTROL('w'), NONE('s') }, cmd, { .s = "split" } }, @@ -423,6 +425,9 @@ static KeyBinding vis_mode_normal[] = { }; static KeyBinding vis_mode_visual[] = { + { { CONTROL('N') }, cursors_select_next, { } }, + { { CONTROL('X') }, cursors_select_skip, { } }, + { { CONTROL('P') }, cursors_remove, { } }, { { KEY(BACKSPACE) }, operator, { .i = OP_DELETE } }, { { KEY(DELETE) }, operator, { .i = OP_DELETE } }, { { CONTROL('O') }, operator, { .i = OP_CURSOR } }, |
