On 2 August 2012 00:21, Rob Pike <robp...@gmail.com> wrote:
> .,.+0 means: from the beginning of . to the end of .+0, and .+0 is the
> null string at the end of .

It just does not work for me like that. (.+#0 seems to do what you describe.)

1) Having a line
asdfasdf asdfasdf asdfasdf | asdfasdfa  asfdsfasdfa
where | represents the current (emty) dot, .+0 selects everything to
the right from the original dot to the end of the line, including the
newline.

2) Having
| asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf
.+0 does nothing

3) Having
asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf |
.+0 selects the newline, and next .+0 selects the empty dot on the
beginning of the next line, like what we start from in the case 2).

This behaviour, along with the mentioned behaviour of +-, where for
| asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf
+- selects the previous line
while for
asdfasdf asdfasdf asdfasdf | asdfasdfa  asfdsfasdfa
it selects the current line
still stays ununderstood by me... (and the last example is contraintuitive).

[sideremark: -+ works even when the empty dot is on the first and last
line of the file, the latter being a problem for +-, which is a
strange asymmetry. How should one then select the line on which a
possibly multiline dot ends and at the same time this is the last line
in the file (which however, you do not have to know if this happens
under some loop command)?]

Any more explanation is highly welcome!
Ruda

Reply via email to