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

Re: About viminfo and vimrc

Expand Messages
  • Dan Sharp
    Redirecting to vim-dev for code discussion... ... By default, Vim first looks in $HOME for the _vimrc and _viminfo files, so you could set the HOME environment
    Message 1 of 3 , Aug 31, 2001
    • 0 Attachment
      Redirecting to vim-dev for code discussion...

      At 03:41 PM 8/31/2001 +0200, Ravi Shankar Sivaraman wrote:
      >HI
      > The viminfo and vimrc files are stored where the vim is installed
      >(In windows). The vimrc file depends upon user, should go in the user
      >specific directory! Atleast the vimrc file is ok, but the viminfo file
      >should be. I think it contains some private things, (like the files edited
      >and marks, etc) and it is not a nice idea when the other user logs into the
      >machine and gets the same viminfo file. It should go to the user directory.
      >(by default)
      >I dont know how this happens in the unix!
      >Regards
      >Ravi

      By default, Vim first looks in $HOME for the _vimrc and _viminfo files, so
      you could set the HOME environment variable to the user's directory and it
      would work like you want. Of course, you are looking for this to be done
      automatically. I don't think it would take much.

      Hmmm...in the sources for init_homedir() it says

      #ifdef WIN3264
      /*
      * Typically, $HOME is not defined on Windows, unless the user has
      * specifically defined it for Vim's sake. However, on Windows NT
      * platforms, $HOMEDRIVE and $HOMEPATH are automatically defined for
      * each user. Try constructing $HOME from these.
      */
      if (var == NULL)
      {
      char_u *homedrive, *homepath;

      homedrive = mch_getenv((char_u *)"HOMEDRIVE");
      homepath = mch_getenv((char_u *)"HOMEPATH");
      if (homedrive != NULL && homepath != NULL)
      {
      sprintf((char *)NameBuff, "%s%s", homedrive, homepath);
      if (NameBuff[0] != NUL)
      var = NameBuff;
      }
      }
      #endif

      but on my NT and my W2k system, HOMEDRIVE=c: and HOMEPATH=\, which isn't
      really much help. I think a better choice would be to use USERPROFILE,
      which points to the Win32 equivalent of the UNIX $HOME and is defined in
      both NT and 2K.

      Anyone else think this is useful/better? Would it be a small-enough change
      to go into the beta?

      Dan Sharp

      Dan Sharp.
    • Bram Moolenaar
      ... I was mentioned before, but I don t recall why we didn t use USERPROFILE. Anyway, I don t want to change something with this much impact now. -- Shit
      Message 2 of 3 , Aug 31, 2001
      • 0 Attachment
        Dan Sharp wrote:

        > but on my NT and my W2k system, HOMEDRIVE=c: and HOMEPATH=\, which isn't
        > really much help. I think a better choice would be to use USERPROFILE,
        > which points to the Win32 equivalent of the UNIX $HOME and is defined in
        > both NT and 2K.
        >
        > Anyone else think this is useful/better? Would it be a small-enough change
        > to go into the beta?

        I was mentioned before, but I don't recall why we didn't use
        USERPROFILE. Anyway, I don't want to change something with this much
        impact now.

        --
        Shit makes the flowers grow and that's beautiful

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Craig Barkhouse
        ... From: Dan Sharp To: Ravi Shankar Sivaraman ; Sent: Friday, August 31, 2001 10:20 AM
        Message 3 of 3 , Sep 2, 2001
        • 0 Attachment
          ----- Original Message -----
          From: "Dan Sharp" <vimuser@...>
          To: "Ravi Shankar Sivaraman" <rsivara1@...>; <vim-dev@...>
          Sent: Friday, August 31, 2001 10:20 AM
          Subject: Re: About viminfo and vimrc


          > but on my NT and my W2k system, HOMEDRIVE=c: and HOMEPATH=\, which isn't
          > really much help. I think a better choice would be to use USERPROFILE,
          > which points to the Win32 equivalent of the UNIX $HOME and is defined in
          > both NT and 2K.

          The HOMEDRIVE and HOMEPATH variables should automatically be defined by NT,
          on a per-user basis. By default, NT uses your profile directory. So on
          W2K/XP, for example, after logging in as Administrator you should have
          HOMEDRIVE=C:, HOMEPATH=\Documents and Settings\Administrator; log in as Dan
          and you should get HOMEDRIVE=C:, HOMEPATH=\Documents and Settings\Dan; etc.

          Are you sure you're not doing anything special to make %HOMEDRIVE%%HOMEPATH%
          poing to C:\? Check the settings on your user account. There is a place
          where you can specify the exact path to your home directory (or
          alternatively, map a drive letter to a network share).
        Your message has been successfully submitted and would be delivered to recipients shortly.