vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 18d918b5cb2807f53b6fcc4706cd508b8ba910cc
parent 590101101bcf1fd86ac62bf62561fab0d76facc8
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 25 Feb 2017 15:36:45 +0100

test/vis: cleanup motion tests

Diffstat:
Dvim/motions/line.in | 2--
Dvim/motions/line.keys | 2--
Dvis/motions/find.in | 8--------
Dvis/motions/find.keys | 7-------
Dvis/motions/find.ref | 8--------
Avis/motions/line-begin.in | 13+++++++++++++
Avis/motions/line-begin.keys | 13+++++++++++++
Avis/motions/line-begin.ref | 13+++++++++++++
Avis/motions/line-char-first.in | 13+++++++++++++
Avis/motions/line-char-first.keys | 13+++++++++++++
Avis/motions/line-char-first.ref | 13+++++++++++++
Avis/motions/line-char-last.in | 13+++++++++++++
Avis/motions/line-char-last.keys | 13+++++++++++++
Avis/motions/line-char-last.ref | 13+++++++++++++
Avis/motions/line-end.in | 13+++++++++++++
Avis/motions/line-end.keys | 13+++++++++++++
Avis/motions/line-end.ref | 13+++++++++++++
Dvis/motions/line.in | 5-----
Dvis/motions/line.keys | 4----
Dvis/motions/line.ref | 5-----
Avis/motions/till-left.in | 15+++++++++++++++
Avis/motions/till-left.keys | 15+++++++++++++++
Avis/motions/till-left.ref | 15+++++++++++++++
Mvis/motions/till-right.in | 22+++++++++++++++-------
Mvis/motions/till-right.keys | 32++++++++++++++------------------
Mvis/motions/till-right.ref | 22+++++++++++++++-------
Dvis/motions/till.in | 8--------
Dvis/motions/till.keys | 8--------
Dvis/motions/till.ref | 8--------
Avis/motions/to-left.in | 15+++++++++++++++
Avis/motions/to-left.keys | 15+++++++++++++++
Avis/motions/to-left.ref | 15+++++++++++++++
Avis/motions/to-right.in | 15+++++++++++++++
Avis/motions/to-right.keys | 15+++++++++++++++
Avis/motions/to-right.ref | 15+++++++++++++++
35 files changed, 335 insertions(+), 97 deletions(-)

diff --git a/vim/motions/line.in b/vim/motions/line.in @@ -1,2 +0,0 @@ -one two three - one two three diff --git a/vim/motions/line.keys b/vim/motions/line.keys @@ -1,2 +0,0 @@ -g_d0 /* move to last char on line ( $ fails ) delete to start of line */ -j$^dw /* go to first non blank of next line and delete word */ diff --git a/vis/motions/find.in b/vis/motions/find.in @@ -1,8 +0,0 @@ -1 find char c (f) -2 find char c with count (2f) -3 find char c using repeat and count (2;) -4 find char a then reverse repeat -5 find char c reverse F -6 find unicode æ -7 find space - diff --git a/vis/motions/find.keys b/vis/motions/find.keys @@ -1,7 +0,0 @@ -fcr|+ -2fc.+ -2;.+ -3fa,.+ -fFFc.+ -fæ.+ -f<Space>. diff --git a/vis/motions/find.ref b/vis/motions/find.ref @@ -1,8 +0,0 @@ -1 find |har c (f) -2 find char | with count (2f) -3 find char | using repeat and count (2;) -4 find char | then reverse repeat -5 find char | reverse F -6 find unicode | -7|find space - diff --git a/vis/motions/line-begin.in b/vis/motions/line-begin.in @@ -0,0 +1,13 @@ +0 To the first character of the line. +1 From start to start +2 From _ to start +3 From end to start 4 empty line \n 5 empty line \r\n + + + 6 Spaces + 7 Tabs +  8 Backspace + 9 Vertical tab + 10 Form feed + 11 Carriage return + 12 Idempotent (count has no effect) diff --git a/vis/motions/line-begin.keys b/vis/motions/line-begin.keys @@ -0,0 +1,13 @@ ++ +d0+ +f_.+ +$.+ +.+ +./[0-9]+ <Enter> +.$n +.$n +.$n +.$n +.$n +.$n +99.$n diff --git a/vis/motions/line-begin.ref b/vis/motions/line-begin.ref @@ -0,0 +1,13 @@ +0 To the first character of the line. +1 From start to start +_ to start + + + +6 Spaces +7 Tabs +8 Backspace +9 Vertical tab +10 Form feed +11 Carriage return +12 Idempotent (count has no effect) diff --git a/vis/motions/line-char-first.in b/vis/motions/line-char-first.in @@ -0,0 +1,13 @@ +^ To the first non-blank character of the line. +1 From start to start +2 From _ to start +3 From end to start 4 empty line \n 5 empty line \r\n + + + 6 Spaces + 7 Tabs +  8 Backspace + 9 Vertical tab + 10 Form feed + 11 Carriage return + 12 Idempotent (count has no effect) diff --git a/vis/motions/line-char-first.keys b/vis/motions/line-char-first.keys @@ -0,0 +1,13 @@ ++ +d^+ +f_.+ +$.+ +.+ +.+ +0.+ +0.+ +0.+ +0.+ +0.+ +0.+ +099.+ diff --git a/vis/motions/line-char-first.ref b/vis/motions/line-char-first.ref @@ -0,0 +1,13 @@ +^ To the first non-blank character of the line. +1 From start to start +_ to start + + + +6 Spaces +7 Tabs + 8 Backspace + 9 Vertical tab + 10 Form feed + 11 Carriage return +12 Idempotent (count has no effect) diff --git a/vis/motions/line-char-last.in b/vis/motions/line-char-last.in @@ -0,0 +1,13 @@ +g_ To the last non-blank character of the line. +1 From start to end +2 From _ to end +3 From end to end 4 empty line \n 5 empty line \r\n + + +6 Spaces +7 Tabs +8 Backspace  +9 Vertical tab +10 Form feed +11 Carriage return +12 Idempotent (count has no effect) diff --git a/vis/motions/line-char-last.keys b/vis/motions/line-char-last.keys @@ -0,0 +1,13 @@ ++ +dg_+ +f_.+ +$.+ +.+ +.+ +$.+ +$.+ +$.+ +$.+ +$.+ +$.+ +$99.+ diff --git a/vis/motions/line-char-last.ref b/vis/motions/line-char-last.ref @@ -0,0 +1,13 @@ +g_ To the last non-blank character of the line. + +2 From +3 From end to end 4 empty line \n 5 empty line \r\ + + +6 Space +7 Tab +8 Backspace +9 Vertical tab +10 Form feed +11 Carriage return +12 Idempotent (count has no effect diff --git a/vis/motions/line-end.in b/vis/motions/line-end.in @@ -0,0 +1,13 @@ +$ To the end of the line. +1 From start to end +2 From _ to end +3 From end to end 4 empty line \n 5 empty line \r\n + + +6 Spaces +7 Tabs +8 Backspace  +9 Vertical tab +10 Form feed +11 Carriage return +12 Idempotent (count has no effect) diff --git a/vis/motions/line-end.keys b/vis/motions/line-end.keys @@ -0,0 +1,13 @@ ++ +d$+ +f_.+ +$.+ +.+ +.+ +2f<Space>.+ +2;.+ +2;.+ +2;.+ +2;.+ +2;.+ +2;99.+ diff --git a/vis/motions/line-end.ref b/vis/motions/line-end.ref @@ -0,0 +1,13 @@ +$ To the end of the line. + +2 From +3 From end to end 4 empty line \n 5 empty line \r\n + + + +7 Tabs +8 Backspace +9 Vertical +10 Form +11 Carriage +12 Idempotent diff --git a/vis/motions/line.in b/vis/motions/line.in @@ -1,5 +0,0 @@ -1 Change start of line. -2 Change end of line. - 3 Change first non blank. -4 Last non blank of line - diff --git a/vis/motions/line.keys b/vis/motions/line.keys @@ -1,4 +0,0 @@ -f.0r|+ -$h.+ -$^.+ -g_.+ diff --git a/vis/motions/line.ref b/vis/motions/line.ref @@ -1,5 +0,0 @@ -| Change start of line. -2 Change end of line| - | Change first non blank. -4 Last non blank of lin| - diff --git a/vis/motions/till-left.in b/vis/motions/till-left.in @@ -0,0 +1,15 @@ +T{char} Till after [count]'th occurrence of {char} to the left. +1 till char c (T) +2 till char c with count (2T) +3 till char c using repeat and count (2;) +4 till char c in reverse direction with count (^2,) +5 till consecutive char ### with count (3T) +6 till consecutive char ### using repeat (;;;) +7 till consecutive char ### using repeat and count (3;) +8 till consecutive char ### in reverse direction with count (^3,) +9 delete # found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till æ unicode +13 till space +14 till tab diff --git a/vis/motions/till-left.keys b/vis/motions/till-left.keys @@ -0,0 +1,15 @@ ++ +$Tcr|+ +$2Tc.+ +$2;.+ +^2,.+ +$3T#.+ +$;;;.+ +$3;.+ +^3,.+ +$d;+ +$d;+ +$d2;+ +$Tær|+ +$T<Space>.+ +$T<Tab>.+ diff --git a/vis/motions/till-left.ref b/vis/motions/till-left.ref @@ -0,0 +1,15 @@ +T{char} Till after [count]'th occurrence of {char} to the left. +1 till char c|(T) +2 till char c|with count (2T) +3 till char c|using repeat and count (2;) +4 till char|c in reverse direction with count (^2,) +5 till consecutive char #|# with count (3T) +6 till consecutive char #|# using repeat (;;;) +7 till consecutive char #|# using repeat and count (3;) +8 till consecutive char #|# in reverse direction with count (^3,) +9 delete # +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till æ|unicode +13 till |pace +14 till |tab diff --git a/vis/motions/till-right.in b/vis/motions/till-right.in @@ -1,7 +1,15 @@ -Till before count occurrence of char to the right. - -Consecutive: ____ -Separated: _ _ _ -Invalid count: __ -Space: # -Tab: # +t{char} Till before [count]'th occurrence of {char} to the right. +1 till char c (t) +2 till char c with count (2t) +3 till char c using repeat and count (2;) +4 till char c in reverse direction with count ($3,) +5 till consecutive char ### with count (3t#) +6 till consecutive char ### using repeat (;;;) +7 till consecutive char ### using repeat and count (3;) +8 till consecutive char ### in reverse direction with count ($3,) +9 delete # found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till unicode æ +13 till space +14 till tab diff --git a/vis/motions/till-right.keys b/vis/motions/till-right.keys @@ -1,19 +1,15 @@ + -3t_ -+ -;r| -;;. -;;. -+ -;. -;. -;. -;. -+ -d3t_ -+ -t<Space> -l. -+ -t<Tab> -l. +tcr|+ +2tc.+ +2;.+ +$3,.+ +3t#.+ +;;;.+ +3;.+ +$3,.+ +d;+ +d;+ +d2;+ +tær|+ +t<Space>.+ +t<Tab>.+ diff --git a/vis/motions/till-right.ref b/vis/motions/till-right.ref @@ -1,7 +1,15 @@ -Till before count occurrence of char to the right. - -Consecutive:|_||_ -Separated:|_|_|_ -Invalid count: __ -Space:|# -Tab:|# +t{char} Till before [count]'th occurrence of {char} to the right. +1 till|char c (t) +2 till char|c with count (2t) +3 till char|c using repeat and count (2;) +4 till char c|in reverse direction with count ($3,) +5 till consecutive char #|# with count (3t#) +6 till consecutive char #|# using repeat (;;;) +7 till consecutive char #|# using repeat and count (3;) +8 till consecutive char #|# in reverse direction with count ($3,) +# found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till unicode|æ +1| till space +14 till tab| diff --git a/vis/motions/till.in b/vis/motions/till.in @@ -1,8 +0,0 @@ -1 till char c (t) -2 till char c with count (2t) -3 till char c using repeat and count (2;) -4 till char a then reverse repeat -5 till char c reverse T -6 till unicode æ -7 till space - diff --git a/vis/motions/till.keys b/vis/motions/till.keys @@ -1,8 +0,0 @@ -tcr|+ -2tc.+ -2;.+ -3ta,.+ -tTTc.+ -tæ.+ -t<Space>. - diff --git a/vis/motions/till.ref b/vis/motions/till.ref @@ -1,8 +0,0 @@ -1 till|char c (t) -2 till char|c with count (2t) -3 till char|c using repeat and count (2;) -4 till char a|then reverse repeat -5 till char c|reverse T -6 till unicode|æ -7 til| space - diff --git a/vis/motions/to-left.in b/vis/motions/to-left.in @@ -0,0 +1,15 @@ +F{char} To [count]'th occurrence of {char} to the left. +1 find char c (F) +2 find char c with count (2F) +3 find char c using repeat and count (2;) +4 find char c in reverse direction with count (^2,) +5 find consecutive char ### with count (2F) +6 find consecutive char ### using repeat (;;) +7 find consecutive char ### using repeat and count (2;) +8 find consecutive char ### in reverse direction with count ($2,) +9 delete # found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till æ unicode +13 till space +14 till tab diff --git a/vis/motions/to-left.keys b/vis/motions/to-left.keys @@ -0,0 +1,15 @@ ++ +$Fcr|+ +$2Fc.+ +$2;.+ +^2,.+ +$2F#.+ +$;;.+ +$2;.+ +^2,.+ +$d;+ +$d;+ +$d2;+ +$Fær|+ +$F<Space>.+ +$F<Tab>.+ diff --git a/vis/motions/to-left.ref b/vis/motions/to-left.ref @@ -0,0 +1,15 @@ +F{char} To [count]'th occurrence of {char} to the left. +1 find char | (F) +2 find char | with count (2F) +3 find char | using repeat and count (2;) +4 find char | in reverse direction with count (^2,) +5 find consecutive char #|# with count (2F) +6 find consecutive char #|# using repeat (;;) +7 find consecutive char #|# using repeat and count (2;) +8 find consecutive char #|# in reverse direction with count ($2,) +9 delete +10 delete not found (d;) +11 delete invalid count # (d2;) +12 till | unicode +13 till|space +14 till | tab diff --git a/vis/motions/to-right.in b/vis/motions/to-right.in @@ -0,0 +1,15 @@ +f{char} To [count]'th occurrence of char to the right. +1 find char c (f) +2 find char c with count (2f) +3 find char c using repeat and count (2;) +4 find char c in reverse direction with count ($3,) +5 find consecutive char ### with count (2f#) +6 find consecutive char ### using repeat (;;) +7 find consecutive char ### using repeat and count (2;) +8 find consecutive char ### in reverse direction with count ($2,) +9 delete # found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 find unicode æ +13 find space +14 find tab diff --git a/vis/motions/to-right.keys b/vis/motions/to-right.keys @@ -0,0 +1,15 @@ ++ +fcr|+ +2fc.+ +2;.+ +$3,.+ +2f#.+ +;;.+ +2;.+ +$2,.+ +d;+ +d;+ +d2;+ +fær|+ +f<Space>.+ +f<Tab>.+ diff --git a/vis/motions/to-right.ref b/vis/motions/to-right.ref @@ -0,0 +1,15 @@ +f{char} To [count]'th occurrence of char to the right. +1 find |har c (f) +2 find char | with count (2f) +3 find char | using repeat and count (2;) +4 find char | in reverse direction with count ($3,) +5 find consecutive char #|# with count (2f#) +6 find consecutive char #|# using repeat (;;) +7 find consecutive char #|# using repeat and count (2;) +8 find consecutive char #|# in reverse direction with count ($2,) + found (d;) +10 delete not found (d;) +11 delete invalid count # (d2;) +12 find unicode | +13|find space +14 find tab |