Loading ...
Sorry, an error occurred while loading the content.
 

Re: Filename in BufWriteCmd

Expand Messages
  • Benji Fisher
    ... ... HTH --Benji Fisher
    Message 1 of 2 , Jul 2, 2002
      Mario Schweigler wrote:
      >
      > Hi,
      >
      > How can I find out the filename in a function that is triggered by
      > BufWriteCmd?
      >
      > 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!
      > Mario

      For testing, I used WinLeave instead of BufWrite:

      :au! WinLeave * let foo = expand("<afile>")
      <change windows>
      :echo foo
      :help <afile>

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.