aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-10 18:30:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-10 19:11:25 +0200
commit47761c6e954a39b93515e3d3193d8736014d1b48 (patch)
tree74b8d5b5ff2113ef8c40dde86371b55ac206b2f3 /vis.c
parent5fbe797b8aa50c434634da30bad1ad67f2ef98fb (diff)
downloadvis-47761c6e954a39b93515e3d3193d8736014d1b48.tar.gz
vis-47761c6e954a39b93515e3d3193d8736014d1b48.tar.xz
Add normal mode commands 'A', 'C', 'D' and 'I'
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/vis.c b/vis.c
index e28668d..cb55d98 100644
--- a/vis.c
+++ b/vis.c
@@ -339,8 +339,12 @@ static void undo(const Arg *arg);
static void redo(const Arg *arg);
/* either part of multiplier or a movement to begin of line */
static void zero(const Arg *arg);
-/* delete from the current cursor position to the start of the previous word */
-static void delete_word(const Arg *arg);
+/* hange/delete from the current cursor position to the end of
+ * movement as indicated by arg->i */
+static void change(const Arg *arg);
+static void delete(const Arg *arg);
+/* perform movement according to arg->i, then switch to insert mode */
+static void insertmode(const Arg *arg);
/* insert register content indicated by arg->i at current cursor position */
static void insert_register(const Arg *arg);
/* show a user prompt to get input with title arg->s */
@@ -580,9 +584,19 @@ static void zero(const Arg *arg) {
count(&(const Arg){ .i = 0 });
}
-static void delete_word(const Arg *arg) {
+static void insertmode(const Arg *arg) {
+ movement(arg);
+ switchmode(&(const Arg){ .i = VIS_MODE_INSERT });
+}
+
+static void change(const Arg *arg) {
+ operator(&(const Arg){ .i = OP_CHANGE });
+ movement(arg);
+}
+
+static void delete(const Arg *arg) {
operator(&(const Arg){ .i = OP_DELETE });
- movement(&(const Arg){ .i = MOVE_WORD_START_PREV });
+ movement(arg);
}
static void insert_register(const Arg *arg) {