aboutsummaryrefslogtreecommitdiff
path: root/config.def.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-08 14:20:47 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-08 14:20:47 +0200
commit2dff85e19e270f030ab43d2954eb8adb05fb232d (patch)
tree46b0a2de721e27b4379d89544dd1e407635941c7 /config.def.h
parentfc57421057fcdcc80080dbc59fae633fc49e0ca5 (diff)
downloadvis-2dff85e19e270f030ab43d2954eb8adb05fb232d.tar.gz
vis-2dff85e19e270f030ab43d2954eb8adb05fb232d.tar.xz
Zero can be both a movement and part of a multiplier
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h
index 6c63301..32aca77 100644
--- a/config.def.h
+++ b/config.def.h
@@ -451,6 +451,13 @@ void action_do(Action *a) {
}
}
+static void zero(const Arg *arg) {
+ if (action.count == 0)
+ movement(&(const Arg){ .i = MOVE_LINE_BEGIN });
+ else
+ count(&(const Arg){ .i = 0 });
+}
+
static void delete_word(const Arg *arg) {
operator(&(const Arg){ .i = OP_DELETE });
movement(&(const Arg){ .i = MOVE_WORD_START_PREV });
@@ -527,7 +534,6 @@ static KeyBinding vis_movements[] = {
{ { CONTROL('J') }, movement, { .i = MOVE_LINE_DOWN } },
{ { CONTROL('N') }, movement, { .i = MOVE_LINE_DOWN } },
{ { KEY(ENTER) }, movement, { .i = MOVE_LINE_DOWN } },
- { { NONE('0') }, movement, { .i = MOVE_LINE_BEGIN } },
{ { NONE('^') }, movement, { .i = MOVE_LINE_START } },
{ { NONE('g'), NONE('_') }, movement, { .i = MOVE_LINE_FINISH } },
{ { NONE('$') }, movement, { .i = MOVE_LINE_END } },
@@ -587,6 +593,7 @@ static KeyBinding vis_textobjs[] = {
};
static KeyBinding vis_operators[] = {
+ { { NONE('0') }, zero, { NULL } },
{ { NONE('1') }, count, { .i = 1 } },
{ { NONE('2') }, count, { .i = 2 } },
{ { NONE('3') }, count, { .i = 3 } },