From bcc479670b2a317042fbfc6acf99f81f8958745f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 12 Apr 2017 20:29:29 +0200 Subject: man: document new count specifier for `g` and `v` commands A few examples: :x g1 selects the first line :x g-1 selects the last line :x g-3, selects the last three lines :x g2,4 selects lines 2, 3 and 4 :x g,5 selects all lines up and including the fifth :x g6, selects all lines starting from the sixth :x g%2 selects all even lines :x v%2 selects all odd lines --- man/vis.1 | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'man') diff --git a/man/vis.1 b/man/vis.1 index b271809..66ec44f 100644 --- a/man/vis.1 +++ b/man/vis.1 @@ -627,10 +627,12 @@ Same as .Ic X , but for files that do not match the regular expression, and the expression is required. -. -.It Ic g/ Ns Ar regexp Ns Ic / Ar command -.It Ic v/ Ns Ar regexp Ns Ic / Ar command -If the range contains +.\" TODO improve markup, use Op macro, make it actually undertandable :/ +.It Ic g Ns [ Ar count ] Ns [ Ar /regexp/ ] Ar command +.It Ic v Ns [ Ar count ] Ns [ Ar /regexp/ ] Ar command +If the +.Ar count +range contains .Po .Ic g .Pc @@ -639,6 +641,36 @@ or does not contain .Ic v .Pc a match for the expression, run command on the range. +.Pp +The +.Ar count +specifier has the following format, where +.Ic n +and +.Ic m +are integers denoting the ranges. +.Bl -tag -width indent +.It Ic n,m +The closed interval from +.Ic n +to +.Ic m . +If +.Ic n +is missing, +.Ic 1 +is substituted. +If +.Ic m +is missing, +.Ic ∞ +is substituted. Negative values are interpreted relative to the last range. +.It Ic %n +Matches every +.Ic n Ns +-th range. +.El +. .El .Pp These may be nested arbitrarily deeply. -- cgit v1.2.3