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

Re: session-file problem in presence of 'set acd'

Expand Messages
  • Bram Moolenaar
    ... Don t keep autochdir set all the time, some things won t work. I ll see if the option can be switched off in the session file until the very end, that
    Message 1 of 5 , Sep 1, 2006
    • 0 Attachment
      Yakov Lerner wrote:

      > When 'acd' is set, 'vim -S' open files in wrong directory.
      > To reproduce:
      >
      > 1. make your ~/.vimrc 1-liner 'set acd'
      > (Alternatively, use use "vim -u NONE -c 'set acd'" instead of vim
      > in commands below).
      > 2. vim ~/xxx # or
      > :he options.txt
      > " now you have two files open: (1) ~/xxx (2)
      > $VIMRUNTIME/doc/options.txt
      > :mksession! /tmp/3
      > :q!
      > 3. vim -S /tmp/3
      > 4. You'll see that buffer 'options.txt' is empty.
      > ':pwd' in window of options.txt shows that current directory is incorrect.
      >
      > The problem is that ':edit' commands in session-file do not
      > contain full paths. Incomplete paths do not work when 'acd' is set.
      > Here are relevant lines from sessionfile, the /tmp/3:
      >
      > cd /usr/local/share/vim/vim70/doc
      > edit ~/xxx
      > edit options.txt
      >
      > This (3rd line)does not work with 'set acd'. I think all filenames
      > must be with full path like
      >
      > edit ~/xxx
      > edit /usr/local/share/vim/vim70/doc/options.txt

      Don't keep 'autochdir' set all the time, some things won't work.

      I'll see if the option can be switched off in the session file until the
      very end, that should help.

      --
      When danger reared its ugly head,
      He bravely turned his tail and fled
      Yes, Brave Sir Robin turned about
      And gallantly he chickened out
      Bravely taking to his feet
      He beat a very brave retreat
      Bravest of the brave Sir Robin
      Petrified of being dead
      Soiled his pants then brave Sir Robin
      Turned away and fled.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Yakov Lerner
      ... Hmmm why, I always been having set acd in my .vimrc for years; and everyhing works just fine. It s convenient. I never had problems. I also have
      Message 2 of 5 , Sep 1, 2006
      • 0 Attachment
        On 9/1/06, Bram Moolenaar <Bram@...> wrote:
        >
        > Yakov Lerner wrote:
        >
        > > When 'acd' is set, 'vim -S' open files in wrong directory.
        > > To reproduce:
        > >
        > > 1. make your ~/.vimrc 1-liner 'set acd'
        > > (Alternatively, use use "vim -u NONE -c 'set acd'" instead of vim
        > > in commands below).
        > > 2. vim ~/xxx # or
        > > :he options.txt
        > > " now you have two files open: (1) ~/xxx (2)
        > > $VIMRUNTIME/doc/options.txt
        > > :mksession! /tmp/3
        > > :q!
        > > 3. vim -S /tmp/3
        > > 4. You'll see that buffer 'options.txt' is empty.
        > > ':pwd' in window of options.txt shows that current directory is incorrect.
        > >
        > > The problem is that ':edit' commands in session-file do not
        > > contain full paths. Incomplete paths do not work when 'acd' is set.
        > > Here are relevant lines from sessionfile, the /tmp/3:
        > >
        > > cd /usr/local/share/vim/vim70/doc
        > > edit ~/xxx
        > > edit options.txt
        > >
        > > This (3rd line)does not work with 'set acd'. I think all filenames
        > > must be with full path like
        > >
        > > edit ~/xxx
        > > edit /usr/local/share/vim/vim70/doc/options.txt
        >
        > Don't keep 'autochdir' set all the time, some things won't work.

        Hmmm why, I always been having 'set acd' in my .vimrc for years;
        and everyhing works just fine. It's convenient. I never had problems.

        I also have equivalent lcd autocmd (in .vimrc) in case autocd
        is not compiled in. It's convenient.

        > I'll see if the option can be switched off in the session file until the
        > very end, that should help.

        Yakov
      • Bram Moolenaar
        ... At least a few plugins don t work with acd . Some of them got fixed and/or perhaps you don t use them. -- DINGO: And after the spanking ... the oral
        Message 3 of 5 , Sep 2, 2006
        • 0 Attachment
          Yakov Lerner wrote:

          > > Don't keep 'autochdir' set all the time, some things won't work.
          >
          > Hmmm why, I always been having 'set acd' in my .vimrc for years;
          > and everyhing works just fine. It's convenient. I never had problems.

          At least a few plugins don't work with 'acd'. Some of them got fixed
          and/or perhaps you don't use them.

          --
          DINGO: And after the spanking ... the oral sex.
          GALAHAD: Oh, dear! Well, I...
          GIRLS: The oral sex ... The oral sex.
          GALAHAD: Well, I suppose I could stay a BIT longer.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
        Your message has been successfully submitted and would be delivered to recipients shortly.