Introduction
Introduction Statistics Contact Development Disclaimer Help
tvi: ^d and ^u - neatvi - [fork] simple vi-type editor with UTF-8 support
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit c54948868fdd6994a66acff21cb980fef4356465
parent 6a4f7acda55fd2175a268b20b308ee70ae2fa38b
Author: Ali Gholami Rudi <[email protected]>
Date: Wed, 17 Jun 2015 19:40:04 +0430
vi: ^d and ^u
Tested by Christian Neukirchen <[email protected]>.
Diffstat:
M vi.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/vi.c b/vi.c
t@@ -22,6 +22,7 @@ static int vi_ybuf; /* current yank buffer */
static char *vi_kmap; /* current insertion keymap */
static int vi_pcol; /* the column requested by | command */
static int vi_printed; /* ex_print() calls since the last comma…
+static int vi_scroll; /* scroll amount for ^f and ^d*/
static void vi_wait(void)
{
t@@ -1066,6 +1067,30 @@ static void vi(void)
break;
redraw = 1;
break;
+ case TK_CTL('u'):
+ if (xrow == 0)
+ break;
+ if (vi_arg1)
+ vi_scroll = vi_arg1;
+ n = vi_scroll ? vi_scroll : xrows / 2;
+ xrow = MAX(0, xrow - n);
+ if (xtop > 0)
+ xtop = MAX(0, xtop - n);
+ redraw = 1;
+ xoff = lbuf_indents(xb, xrow);
+ break;
+ case TK_CTL('d'):
+ if (xrow == lbuf_len(xb) - 1)
+ break;
+ if (vi_arg1)
+ vi_scroll = vi_arg1;
+ n = vi_scroll ? vi_scroll : xrows / 2;
+ xrow = MIN(MAX(0, lbuf_len(xb) - 1), xrow + n);
+ if (xtop < lbuf_len(xb) - xrows)
+ xtop = MIN(lbuf_len(xb) - xrows, xtop …
+ redraw = 1;
+ xoff = lbuf_indents(xb, xrow);
+ break;
case TK_CTL('z'):
term_pos(xrows, 0);
term_suspend();
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.