vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 6456a5dcddc3f4fae1b50e167028e7d67b3edb58 parent 5d9a51af60bd73d99f5e8422399072b5a99f7e91 Author: Marc André Tanner <mat@brain-dump.org> Date: Mon, 2 Nov 2015 16:47:25 +0100 vis: make I command repeatable Diffstat:
| M | config.def.h | | | 2 | +- |
| M | main.c | | | 6 | ++++++ |
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h @@ -194,7 +194,7 @@ static KeyBinding vis_mode_normal[] = { { "A", ACTION(APPEND_LINE_END) }, { "C", ALIAS("c$") }, { "D", ALIAS("d$") }, - { "I", ALIAS("^i") }, + { "I", ACTION(INSERT_LINE_START) }, { ".", ACTION(REPEAT) }, { "o", ACTION(OPEN_LINE_BELOW) }, { "O", ACTION(OPEN_LINE_ABOVE) }, diff --git a/main.c b/main.c @@ -202,6 +202,7 @@ enum { VIS_ACTION_WINDOW_PREV, VIS_ACTION_APPEND_CHAR_NEXT, VIS_ACTION_APPEND_LINE_END, + VIS_ACTION_INSERT_LINE_START, VIS_ACTION_OPEN_LINE_ABOVE, VIS_ACTION_OPEN_LINE_BELOW, VIS_ACTION_JOIN_LINE_BELOW, @@ -744,6 +745,11 @@ static KeyAction vis_action[] = { "Append text after the end of the line", insertmode, { .i = MOVE_LINE_END }, }, + [VIS_ACTION_INSERT_LINE_START] = { + "insert-line-start", + "Insert text before the first non-blank in the line", + insertmode, { .i = MOVE_LINE_START }, + }, [VIS_ACTION_OPEN_LINE_ABOVE] = { "open-line-above", "Begin a new line above the cursor",