Sunday, September 25, 2011

RE: sort content of a register

porphyry5 wrote:
> One by one I have appended a number of lines to a register
> ("z). I need to sort them and then paste them at the start
> of the document.
> Without complaint, vim accepts the command :"zsort but the
> content of "z is unchanged. Is it possible to do this in the
> register, or must I paste it into the document and sort it there?

The quote (") in the command line is a comment, so the text
following the quote is ignored.

Use something like this to paste register z
"zp

Use this to sort the pasted lines:
:'[,']sort

The '[ and '] are marks for the first and last lines inserted by
the paste command.

John

--
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

No comments:

Post a Comment