[Linux-disciples] Sorting lines matching a pattern
Stephen R Laniel
steve at laniels.org
Sun Jul 24 22:12:34 EDT 2005
The file corresponding to
http://laniels.org/weblog/books/to_read_2005.html
looks like so:
To read, 2005
meta-creation_date: 1/4/2005 03:28:21
* Fatsis, Stefan. "Word Freak"[book]
* Abbey, Edward. "The Monkey Wrench Gang"[book]
* Adams, Henry. "The Education of Henry Adams"[book]
* Atwood, Margaret. "The Handmaid's Tale"[book]
* Aurelius, Marcus, "Somethingorother"[book]
[and so on]
Whenever I save that file, I'd like all the lines beginning
with '*' to get sorted. I thought something like so in vim
would do the trick:
:g/^\*/!sort
but it was not to be. I'm still not totally comfortable with
the 'g[lobal]' command, for some reason, but I gather that
the above command isn't lumping all of the '*' lines
together and sorting them as one -- rather, it's maybe
grabbing them one at a time and executing !sort on them
individually.
Can someone suggest how I might do what I want in vim?
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050724/93456b3b/attachment.pgp
More information about the Linux-disciples
mailing list