Sunday, September 25, 2011

Re: sort content of a register

On Sep 25, 1:46 pm, porphyry5 <gl00...@gmail.com> 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.

>  Is it possible to do this in the register ...

:let @z = join(sort(split(@z, "\n")), "\n") . "\n"

or, to add at the end, leaving the register as it was,

:call append(line('$'),sort(split(@z, "\n")))

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