Tuesday, January 25, 2011

Re: Writing to filename in variable

Thanks for your suggestions. I ended up using :

let filename = "blah.txt"
sav %:s/.*/\=file_name/


On Tue, Jan 25, 2011 at 7:39 PM, ZyX <zyx.vim@gmail.com> wrote:
Reply to message «Writing to filename in variable»,
sent 03:31:46 26 January 2011, Wednesday
by Colin Beighley:

If your filename cannot contain newlines:
   w `=variable`
. If it can:
   execute "w ".fnameescape(variable)
.

Original message:
> Hello,
>
> I'd like to be able to write to a file in a variable name, or alternatively
> change the current filename (the % register) or the alternate filename. Is
> there any way to do any of these?
>
> Thanks
> Colin

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