Wednesday, June 17, 2015

Re: sorting lines by term inside a tag

On 2015-06-17 22:38, Christian Brabandt wrote:
> > The {pattern} argument tells the :sort command to ignore the text
> > matching the pattern. See
> >
> > :help :sort
>
> Except when you provide the 'r' flag (which I can never remember.
> Anybody knows, what the r could stand for?)

I'm glad I'm not the only one thrown by this. I remember that the
default behavior is *not* what I want/expect (I'd expect that a
search pattern would *find* the thing I want to sort on), and that
there's some flag that controls that behavior to give me what I
want. But the same with you, I have to look it up EVERY SINGLE TIME.
As best I can tell from ex_cmds.c the "r" stands for
"r[egular e]x[pression]" search ("static int sort_rx; /* sort on
regex instead of skipping it */")

Which is indeed confusing because ":sort" can/does use a regexp even
with this flag set, just for the purposes of skipping instead of
finding the thing to sort.

-tim




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: