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

sessions and $HOME

Expand Messages
  • Ron Aaron
    Hi all - I have been bit by the fact that sessions normalize to the $HOME directory (which is great), but I really want the buffers normalized to the cwd .
    Message 1 of 3 , Jan 29, 2001
    • 0 Attachment
      Hi all -

      I have been bit by the fact that sessions normalize to the $HOME directory
      (which is great), but I really want the buffers normalized to the cwd .
      Here's why:

      I use project within a directory structure, and I move projects back and
      forth between Linux and Win32. The 'unix' and 'slash' sessionoptions work
      wonders for me here, but obviously H$HOME is not the same on these machines.
      What ends up happening is that I am saving a path like

      ~/src/edit.c

      on my Windows machine, because I have $HOME set to c:\project\

      but on my Linux machine, this doesn't work (!).

      What I would much prefer in this case, is that the names get normalized
      *relative to pwd*:

      src/edit.c

      which is portable from one machine to another.

      Obviously, anything *not* relative will have a full (incompatible) path; but
      that's ok.

      Is there a way to do what I want, or is it trivial to make a patch to make
      it optionally work this way?

      Thanks!
      Ron
    • Bram Moolenaar
      ... Apparently the shortening of paths doesn t work as expected. When sessionoptions contains sesdir Vim first changes directory to where the session file
      Message 2 of 3 , Jan 29, 2001
      • 0 Attachment
        Ron Aaron wrote:

        > I have been bit by the fact that sessions normalize to the $HOME directory
        > (which is great), but I really want the buffers normalized to the cwd .
        > Here's why:
        >
        > I use project within a directory structure, and I move projects back and
        > forth between Linux and Win32. The 'unix' and 'slash' sessionoptions work
        > wonders for me here, but obviously H$HOME is not the same on these machines.
        > What ends up happening is that I am saving a path like
        >
        > ~/src/edit.c
        >
        > on my Windows machine, because I have $HOME set to c:\project\
        >
        > but on my Linux machine, this doesn't work (!).
        >
        > What I would much prefer in this case, is that the names get normalized
        > *relative to pwd*:
        >
        > src/edit.c
        >
        > which is portable from one machine to another.
        >
        > Obviously, anything *not* relative will have a full (incompatible) path; but
        > that's ok.
        >
        > Is there a way to do what I want, or is it trivial to make a patch to make
        > it optionally work this way?

        Apparently the shortening of paths doesn't work as expected. When
        'sessionoptions' contains "sesdir" Vim first changes directory to where the
        session file is. The path to a file should the be relative to this directory,
        if possible. Similarly "curdir" should cause paths to be shortened relative
        to the current directory. There is some code to do this, but apparently it
        isn't working.

        --
        hundred-and-one symptoms of being an internet addict:
        64. The remote to the T.V. is missing...and you don't even care.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Ron Aaron
        I didn t have sesdir in the options; it *does* work as you described, with that option. Thank you, and just ignore my whine ... Ron ... directory,
        Message 3 of 3 , Jan 29, 2001
        • 0 Attachment
          <blush>

          I didn't have 'sesdir' in the options; it *does* work as you described, with
          that option.

          Thank you, and just ignore my whine ...

          Ron

          >> What I would much prefer in this case, is that the names get normalized
          >> *relative to pwd*:
          >>
          >> src/edit.c

          >Apparently the shortening of paths doesn't work as expected. When
          >'sessionoptions' contains "sesdir" Vim first changes directory to where the
          >session file is. The path to a file should the be relative to this
          directory,
        Your message has been successfully submitted and would be delivered to recipients shortly.