Re: Filename in BufWriteCmd
- Mario Schweigler wrote:
>For testing, I used WinLeave instead of BufWrite:
> How can I find out the filename in a function that is triggered by
> I mean for example if I call
> :w abc.txt
> in cmdline, and this triggers my function, how can I get the "abc.txt"
> in this function? I have tried v:cmdarg, but it did not contain
> anything. I already looked in the help about this topic, but I do not
> quite understand it...
> Any suggestions?
> Thanks in advance!
:au! WinLeave * let foo = expand("<afile>")
HTH --Benji Fisher