From 5fbe797b8aa50c434634da30bad1ad67f2ef98fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 10 Sep 2014 18:01:05 +0200 Subject: Add normal mode key binding for 'r' --- vis.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index ab6529d..e28668d 100644 --- a/vis.c +++ b/vis.c @@ -313,6 +313,8 @@ static void insert_newline(const Arg *arg); static void split(const Arg *arg); /* perform last action i.e. action_prev again */ static void repeat(const Arg *arg); +/* replace character at cursor with one read form keyboard */ +static void replace(const Arg *arg); /* adjust action.count by arg->i */ static void count(const Arg *arg); /* force operator to linewise (if arg->b is set) */ @@ -483,6 +485,13 @@ static void repeat(const Arg *arg) { action_do(&action); } +static void replace(const Arg *arg) { + Key k = getkey(); + if (!k.str[0]) + return; + editor_replace_key(vis, k.str, strlen(k.str)); +} + static void count(const Arg *arg) { action.count = action.count * 10 + arg->i; } -- cgit v1.2.3