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

Re: autocmd: variables within pattern are ignored

Expand Messages
  • Neil Bird
    Around about 02/03/05 10:04, Mathias Michaelis typed ... ... Just as a test case, could you set temp correctly *in* the environment before calling vim, and
    Message 1 of 3 , Mar 2, 2005
      Around about 02/03/05 10:04, Mathias Michaelis typed ...
      > autocmd BufReadPre $temp/RAR* setlocal noswapfile
      > In spite of all this care, vim ignores the autocmd :-(

      Just as a test case, could you set 'temp' correctly *in* the
      environment before calling vim, and comment out the assignments in the
      vimrc?

      --
      [neil@fnx ~]# rm -f .signature
      [neil@fnx ~]# ls -l .signature
      ls: .signature: No such file or directory
      [neil@fnx ~]# exit
    • Mathias Michaelis
      Hello Neil Bird ... As I said: TEMP is set correctly, but is converted into 8.3 convention -- not by vim, but by Billy s Software. I can do nothing against it.
      Message 2 of 3 , Mar 2, 2005
        Hello Neil Bird

        >> autocmd BufReadPre $temp/RAR* setlocal noswapfile
        >> In spite of all this care, vim ignores the autocmd :-(
        >>
        > Just as a test case, could you set 'temp' correctly *in* the
        > environment before calling vim, and comment out the assignments
        > in the vimrc?
        >
        As I said: TEMP is set correctly, but is converted into 8.3
        convention -- not by vim, but by Billy's Software. I can do nothing
        against it. Therefore I defined a new variable TMP. Alas, this was
        converted too :-( Therefore, I defined yet another variable: TMPDIR.
        This was not converted anymore :-)

        I can see this conversion in a CMD window by typing

        echo %TEMP%
        echo %TMP%
        echo %TMPDIR%

        as well as within vim by typing

        echo $TEMP
        echo $TMP
        echo $TMPDIR

        vim doesn't make any conversions, even the path separators \ aren't
        changed.

        But wait -- now I found the reason: autocmd _does_ some conversions
        by its own!!! It changes all \ into /. This is why my lines

        let $temp = substitute($TMPDIR, ';', ',', 'g')
        let $temp = substitute($temp, '\\', '/', 'g')
        let $temp = substitute($temp, ' ', '\\ ', 'g')

        are simply too much. I have only to write

        autocmd BufReadPre $TMPDIR/* setlocal noswapfile

        and then all things are fine. Hmmm ... one has to find all this
        magic metamorphosis first :-\

        But nevertheless I have some feature requests for vim under windows:

        - autocmd pattern doesn't recognize short 8.3 path names and can't
        compare them against long path names.

        - autocmd pattern do only compare names, but not interpret their
        meanings. This is why the two paths "C:/bar" and "C:/foo/../bar"
        are treated as different locations. This is why contructions like

        autocmd XYZ $SOME_PATH/../*

        never do work.

        With kind regards and thanks for help

        Mathias
      Your message has been successfully submitted and would be delivered to recipients shortly.