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

Loading Vimfiles On WIndows With GVimPortable

Expand Messages
  • Tom Purl
    I m trying to use Gvim on Windows from a USB thumbdrive. I found and installed the GvimPortable project (http://portablegvim.sourceforge.net/), and it works
    Message 1 of 6 , Nov 30, 2006
    • 0 Attachment
      I'm trying to use Gvim on Windows from a USB thumbdrive. I found and
      installed
      the GvimPortable project (http://portablegvim.sourceforge.net/), and it works
      pretty well.

      The only problem is that I would like to use a non-standard location for
      my vimfiles directory. Here's the basic directory layout that I would
      like to use:

      USB_ROOT
      |
      |__/Apps
      |
      |__/conf
      | |
      | |__/vim
      | |
      | |__vimrc
      | |
      | |__/vimfiles (my custom vimfiles dir)
      |
      |__/GVimPortable
      |
      |__GVimPortable.exe (which launches gvim)
      |__GVimPortable.ini (which has some config options)

      Using this custom directory structure, I hope to protect my custom
      vimfiles directory when I upgrade GvimPortable (or any other app on my
      thumbdrive).

      I'm currently able to set the location of the vimrc file using the
      GVimPortable.ini file, but I'm unable to specify the location of my
      custom vimfiles directory. Since my vimfiles directory is usually
      placed in my $HOME directory, I tried putting both of the following
      commands into my vimrc:

      let $HOME = "."
      let $HOME = "E:/Apps/_conf/vim"

      Both commands seems to change the value of the $HOME dir, but it does
      nothing to load the plugins and such in my custom vimfiles directory.

      Does anyone know how to fix this?

      Thanks in advance!

      Tom Purl
    • A.J.Mechelynck
      ... I suggest the following variation, which I think will work: USB_ROOT __ Apps __ Vim ... __ vim70 ... __ tutor __ Vim tutor files Leave %HOME% at its
      Message 2 of 6 , Nov 30, 2006
      • 0 Attachment
        Tom Purl wrote:
        > I'm trying to use Gvim on Windows from a USB thumbdrive. I found and
        > installed
        > the GvimPortable project (http://portablegvim.sourceforge.net/), and it works
        > pretty well.
        >
        > The only problem is that I would like to use a non-standard location for
        > my vimfiles directory. Here's the basic directory layout that I would
        > like to use:
        >
        > USB_ROOT
        > |
        > |__/Apps
        > |
        > |__/conf
        > | |
        > | |__/vim
        > | |
        > | |__vimrc
        > | |
        > | |__/vimfiles (my custom vimfiles dir)
        > |
        > |__/GVimPortable
        > |
        > |__GVimPortable.exe (which launches gvim)
        > |__GVimPortable.ini (which has some config options)
        >
        > Using this custom directory structure, I hope to protect my custom
        > vimfiles directory when I upgrade GvimPortable (or any other app on my
        > thumbdrive).
        >
        > I'm currently able to set the location of the vimrc file using the
        > GVimPortable.ini file, but I'm unable to specify the location of my
        > custom vimfiles directory. Since my vimfiles directory is usually
        > placed in my $HOME directory, I tried putting both of the following
        > commands into my vimrc:
        >
        > let $HOME = "."
        > let $HOME = "E:/Apps/_conf/vim"
        >
        > Both commands seems to change the value of the $HOME dir, but it does
        > nothing to load the plugins and such in my custom vimfiles directory.
        >
        > Does anyone know how to fix this?
        >
        > Thanks in advance!
        >
        > Tom Purl
        >
        >

        I suggest the following variation, which I think will work:

        USB_ROOT
        \__ Apps
        \__ Vim
        |__ vimrc (optional: system vimrc)
        |__ _vimrc (user vimrc, if not in %HOME%)
        |__ vimfiles
        | \__ user scripts, not distributed with vim
        | no executables; otherwise
        | same directory astructure as below
        \__ vim70
        |__ gvim.exe
        |__ vim.exe
        |__ various global scripts and programs
        |__ autoload
        | \__ autoload scripts
        |__ colors
        | \__ colorschemes
        |__ compiler
        | \__ compiler scripts
        |__ doc
        | \__ help files
        |__ ftplugin
        | \__ filetype-plugins
        |__ indent
        | \__ indent scripts
        |__ keymap
        | \__ keymaps
        |__ lang
        | \__ menu translations
        | in subdirectories: message translations
        |__ macros
        | \__ miscellaneous
        |__ plugin
        | \__ global plugins
        |__ print
        | \__ *.ps
        |__ spell
        | \__ spelling dictionaries
        |__ syntax
        | \__ syntax scripts
        |__ tools
        | \__ various sources, shell scripts, etc.
        \__ tutor
        \__ Vim tutor files

        Leave %HOME% at its usual setting. Put neither a _vimrc nor a .vimrc in it if
        you want to use the _vimrc on the USB key

        Set a few other environment variables as follows (you may want to set them
        from a "startup" script run from somewhere on the USB key if plugged).

        SET VIM_VERSION=70
        SET VIM=%USB_ROOT%\Apps\Vim
        PATH %USB_ROOT%\Apps\Vim\vim%VIM_VERSION%;%PATH%

        Invoking "vim" or "gvim" will then load Vim from the USB key. It will
        spontaneously set $VIMRUNTIME to $USB_ROOT/Apps/Vim/vim70 which is the proper
        setting for this directory architecture.

        Your user files (in $VIM and $VIM/vimfiles but not $VIM/vim70) are kept apart
        from the distribution (in $VIM/vim70). Startup files peculiar to Vim, but
        which don't come from the distribution, can reside in $VIM.

        When Vim 7.1 comes out, you will install the new distribution in $VIM (which
        the installer will probably propose as default), it will create a directory
        tree starting at $VIM/vim71 and install itself into it. You will then change
        the first "set" line above to

        SET VIM_VERSION=71

        , remove the $VIM/vim70 directory tree, and leave the rest unchanged.


        Best regards,
        Tony.
      • Tom Purl
        Thanks for the advice Al! ... [snip] ... I guess I could just merge my personal vimfiles dir with the $VIM/vimfiles dir, but then wouldn t I have to re-merge
        Message 3 of 6 , Nov 30, 2006
        • 0 Attachment
          Thanks for the advice Al!

          > On 30/11/06, Tom Purl <tom@...> wrote:

          >>I'm trying to use Gvim on Windows from a USB thumbdrive. I found and
          >>installed the GvimPortable project
          >>(http://portablegvim.sourceforge.net/), and it works pretty well.

          > [snip]

          >>Using this custom directory structure, I hope to protect my custom
          >>vimfiles directory when I upgrade GvimPortable (or any other app on
          >>my thumbdrive).

          > [snip]

          >>Does anyone know how to fix this?

          [snip]

          > On my USB stick is a directory structure thus:
          >
          > /vim
          > - /vim70
          > - /vimfiles
          > - _gvimrc
          > - _vimrc
          >
          > vim70 is the standard vim directory, vimfiles is my vimfiles
          > directory. Running U:/vim/vim70/gvim70 automatically finds the
          > vimrc/gvimrc files and the vimfiles directory and upgrading is simply
          > a case of changing the vim70 directory. In practice, I have _vimrc
          > and _gvimrc in the format shown below and the real vimrc file in the
          > vimfiles directory. This allows me to have the entirety of vimfiles
          > in a subversion repository to keep my USB stick, windows machine
          > (C:\vim\vimfiles) and Linux PC (~/.vim) synchronised.

          I guess I could just merge my personal vimfiles dir with the
          $VIM/vimfiles dir, but then wouldn't I have to re-merge it every time I
          upgrade VIM? If so, then how difficult is that for you?

          > What does GvimPortable offer over this sort of arrangement?

          Not much really I guess. I think some of its exe's are compressed
          somehow, and it's a simpler installation process, but that's about it.

          > Regards,
          >
          > Al
          >
          > P.S. If you are interested, I can zip up my U:\vim directory and send
          > you a copy...

          That's a very generous offer , but I don't think I need that yet.

          Thanks again!

          Tom Purl
        • Tom Purl
          Thanks a ton for all of the help AJ, Al, and Gary. I basically took did what AJ and Al suggested, including replacing the GVimPortable runtime with the
          Message 4 of 6 , Nov 30, 2006
          • 0 Attachment
            Thanks a ton for all of the help AJ, Al, and Gary. I basically took
            did what AJ and Al suggested, including replacing the GVimPortable
            runtime with the official one.

            I forgot that the vimfiles directory under $VIM doesn't contain any
            files, so I simply placed my vimfiles dir there and also placed my
            _vimrc in the same directory. Now everythign works exactly like I want
            it to.

            Thanks again!

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