Tuesday, January 25, 2011

Re: Writing to filename in variable

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

No comments: