vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit ccb832f25963f65bd78fb57dd8fe82f9c1eece6d parent 38272cd3bddbd9f918f35cbe5cdcaee20e8fb673 Author: Marc André Tanner <mat@brain-dump.org> Date: Sat, 11 Feb 2017 15:18:42 +0100 test/vis: drop cpp(1) as a preprocessor It is not worth the trouble to deal with different escaping rules. The tests should be relatively small and self contained anyway, hence comments should not be that important. Diffstat:
| D | vis/multiple-cursors/basic.keys | | | 6 | ------ |
| R | vis/multiple-cursors/basic.in -> vis/multiple-cursors/new-start-of-line.in | | | 0 | |
| A | vis/multiple-cursors/new-start-of-line.keys | | | 6 | ++++++ |
| R | vis/multiple-cursors/basic.ref -> vis/multiple-cursors/new-start-of-line.ref | | | 0 | |
| M | vis/multiple-cursors/normal-mode-wq.in | | | 12 | ++++++++---- |
| M | vis/multiple-cursors/normal-mode-wq.keys | | | 8 | ++++---- |
| M | vis/multiple-cursors/normal-mode-wq.ref | | | 12 | ++++++++---- |
| M | vis/prompt/history.keys | | | 12 | ++++++------ |
| M | vis/visrc.lua | | | 2 | +- |
9 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/vis/multiple-cursors/basic.keys b/vis/multiple-cursors/basic.keys @@ -1,6 +0,0 @@ -vGI /* create cursor at start of every line */ -df<Space> /* delete to first space */ -. /* delete to second space */ -A : end<Escape> /* append " : end" to line */ -. /* repeat */ -u /* undo */ diff --git a/vis/multiple-cursors/basic.in b/vis/multiple-cursors/new-start-of-line.in diff --git a/vis/multiple-cursors/new-start-of-line.keys b/vis/multiple-cursors/new-start-of-line.keys @@ -0,0 +1,6 @@ +vGI +df<Space> +. +A : end<Escape> +. +u diff --git a/vis/multiple-cursors/basic.ref b/vis/multiple-cursors/new-start-of-line.ref diff --git a/vis/multiple-cursors/normal-mode-wq.in b/vis/multiple-cursors/normal-mode-wq.in @@ -1,4 +1,8 @@ -1: first -2: second -3: third -4: fourth +make +sure +:wq +works +when +multiple +cursors +exist diff --git a/vis/multiple-cursors/normal-mode-wq.keys b/vis/multiple-cursors/normal-mode-wq.keys @@ -1,4 +1,4 @@ -vGI /* create cursor at start of every line */ -<C-k> /* move primary cursor up */ -<C-p> /* remove primary cursor */ -i /* switch to insert mode, so that <Esc> after test leaves cursors active */ +vGI +<C-k> +<C-p> +i diff --git a/vis/multiple-cursors/normal-mode-wq.ref b/vis/multiple-cursors/normal-mode-wq.ref @@ -1,4 +1,8 @@ -1: first -2: second -3: third -4: fourth +make +sure +:wq +works +when +multiple +cursors +exist diff --git a/vis/prompt/history.keys b/vis/prompt/history.keys @@ -1,6 +1,6 @@ -:-0+0x/line/c/word/<Enter> /* replace something on first line */ -:2<Enter>l /* select second line */ -:<Up><Up><Enter> /* repeat replacement */ -:e<Backspace><Backspace> /* simulate a typo on the command line */ -:3<Enter>l /* select third line */ -:<Up><Up><Enter> /* repeat replacement */ +:-0+0x/line/c/word/<Enter> +:2<Enter>l +:<Up><Up><Enter> +:e<Backspace><Backspace> +:3<Enter>l +:<Up><Up><Enter> diff --git a/vis/visrc.lua b/vis/visrc.lua @@ -5,7 +5,7 @@ vis.events.win_open = function(win) if name then -- use the corresponding test.lua file name = string.gsub(name, '%.in$', '') - local file = assert(io.popen(string.format("cpp -P '%s.keys'", name), 'r')) + local file = io.open(string.format("%s.keys", name)) local keys = file:read('*all') keys = string.gsub(keys, '%s*\n', '') keys = string.gsub(keys, '<Space>', ' ')