Introduction
Introduction Statistics Contact Development Disclaimer Help
tvi: ZZ command - neatvi - [fork] simple vi-type editor with UTF-8 support
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit 4ee7fa4c339feedbcca65be80cc546bda8c39dd8
parent da7dfd18e4e2895bd076ea86001f72709ac93210
Author: Christian Neukirchen <[email protected]>
Date: Wed, 17 Jun 2015 18:10:09 +0200
vi: ZZ command
Diffstat:
M vi.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/vi.c b/vi.c
t@@ -1040,7 +1040,7 @@ static void vi(void)
} else if (mv == 0) {
char *cmd;
int c = vi_read();
- int z, g;
+ int k;
if (c <= 0)
continue;
lbuf_mark(xb, '*', xrow, xoff);
t@@ -1161,8 +1161,8 @@ static void vi(void)
redraw = 1;
break;
case 'z':
- z = vi_read();
- switch (z) {
+ k = vi_read();
+ switch (k) {
case '\n':
xtop = vi_arg1 ? vi_arg1 : xrow;
break;
t@@ -1176,19 +1176,19 @@ static void vi(void)
break;
case 'l':
case 'r':
- xdir = z == 'r' ? -1 : +1;
+ xdir = k == 'r' ? -1 : +1;
break;
case 'L':
case 'R':
- xdir = z == 'R' ? -2 : +2;
+ xdir = k == 'R' ? -2 : +2;
break;
}
redraw = 1;
break;
case 'g':
- g = vi_read();
- if (g == '~' || g == 'u' || g == 'U')
- if (!vc_motion(g))
+ k = vi_read();
+ if (k == '~' || k == 'u' || k == 'U')
+ if (!vc_motion(k))
redraw = 1;
break;
case 'x':
t@@ -1230,6 +1230,11 @@ static void vi(void)
if (!vc_motion('y'))
redraw = 1;
break;
+ case 'Z':
+ k = vi_read();
+ if (k == 'Z')
+ ex_command("x");
+ break;
case '~':
vi_back(' ');
if (!vc_motion('~'))
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.