Sunday, April 1, 2012

Re: Write register contents to file

On 02:00 Sun 01 Apr , howard Schwartz wrote:
> I would like to write the contents of a register to a file. Easy enough to
> grab the contents with let variable = getreg('a'). It would then be easy
> if :echo variable > file worked like unix echo, but it doesnt. Any simple way
> to get contents of some register a into a file of my choosing? There is a
> writelist() function, but I do not know how to get the context of a register
> into a list.
>
>
> --
> 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

What about

:exe "!echo ".variable." > /tmp/file"

or

redir! /tmp/file
echo variable
redir end

Best,
Marcin

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