130103RE: Write register contents to file
- Apr 1, 2012howard Schwartz wrote:
> I would like to write the contents of a register to a file.The following writes the default yank register to file x.tmp.
> 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.
:call writefile(split(@@, "\n", 1), 'x.tmp')
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
- << Previous post in topic Next post in topic >>