diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-03-31 12:20:17 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-03-31 12:31:23 +0200 |
| commit | 6f44057d09b865e9c7e443cd7d7adb8e541121db (patch) | |
| tree | 85306ea233bcf9acb62fbe95f7f050ab59344880 /main.c | |
| parent | 9c48a188a51a971d65a6ce764733745fd163f017 (diff) | |
| download | vis-6f44057d09b865e9c7e443cd7d7adb8e541121db.tar.gz vis-6f44057d09b865e9c7e443cd7d7adb8e541121db.tar.xz | |
vis: add non-default actions for vi compatible n/N motions
The following key mappings should result in the vi behavior:
:map! normal n <vis-motion-search-repeat>
:map! normal N <vis-motion-search-repeat-reverse>
The default remains unchanged, that is `n` (`N`) always searches towards
the end (start) of the file.
Fix #470
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -173,6 +173,8 @@ enum { VIS_ACTION_CURSOR_WINDOW_LINE_BOTTOM, VIS_ACTION_CURSOR_SEARCH_REPEAT_FORWARD, VIS_ACTION_CURSOR_SEARCH_REPEAT_BACKWARD, + VIS_ACTION_CURSOR_SEARCH_REPEAT, + VIS_ACTION_CURSOR_SEARCH_REPEAT_REVERSE, VIS_ACTION_CURSOR_SEARCH_WORD_FORWARD, VIS_ACTION_CURSOR_SEARCH_WORD_BACKWARD, VIS_ACTION_WINDOW_PAGE_UP, @@ -525,6 +527,16 @@ static const KeyAction vis_action[] = { VIS_HELP("Move cursor to previous match in backward direction") movement, { .i = VIS_MOVE_SEARCH_REPEAT_BACKWARD } }, + [VIS_ACTION_CURSOR_SEARCH_REPEAT] = { + "vis-motion-search-repeat", + VIS_HELP("Move cursor to next match") + movement, { .i = VIS_MOVE_SEARCH_REPEAT } + }, + [VIS_ACTION_CURSOR_SEARCH_REPEAT_REVERSE] = { + "vis-motion-search-repeat-reverse", + VIS_HELP("Move cursor to next match in opposite direction") + movement, { .i = VIS_MOVE_SEARCH_REPEAT_REVERSE } + }, [VIS_ACTION_CURSOR_SEARCH_WORD_FORWARD] = { "vis-motion-search-word-forward", VIS_HELP("Move cursor to next occurence of the word under cursor") |
