Eric Leenman wrote:
Hi,

Is it possible to start and use vim as an old exe file or com file? (don't know if the terminolgy is ok) What I mean is that old windows programs for windows 95 where just exe files, and by copy them on a pc and starting them they just work.

Some of them, maybe. (g)vim, even for Win95, was much more than "just an exe file", unless you mean a self-installer containing an archive of the whole distribution.

A Vim installation contains, not only an editor executable, but also a number of support files including *.vim scripts and *.txt help files.


Nowadays you have to install them first before you can use them.
I recently switched jobs, and the company is fine, but they have an IT-policy that users don't have administration rights. When I asked them to install gvim, they said we use TextPad, company policy. It's the first company that I ran into this, with a @[EMAIL PROTECTED] policy, but I have to live with it.

What I now want is:
Preference 1:
To copy and paste a (g)vim.exe file without the need to install it, or administrator rights.

With just a gvim.exe, you would lack many great features such as help, filetype recognition, syntax highlighting, directory browsing, foreign language support in messages and menus, etc. etc. etc. I would not call that a "functioning" Vim.

If this is possible, how to do this?

I think you could install Vim in "user space", for instance in "My Documents\Vim\vim70" and below. Try downloading Steve Hall's self-installer from https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721 and telling it to install into a Vim folder under your "My documents" folder. (The installer will create a vim70 folder there and put everything into that vim70 folder and subfolders of it that it will also create.) You may have to create that "My Documents\Vim" prior to starting the installer but I'm not sure. I hope the installer will be clever enough not to try modifying the HKEY_LOCAL_MACHINE (but only the HKEY_CURRENT_USER) registry if you install from a non-admin account.

And if to re-compile vim how do you this.

To compile Vim for Windows, see http://users.skynet.be/antoine.mechelynck/vim/compile.htm . It takes some work to get it running but it can be done (I know: I did it myself); however, if installing Vim is too much for you, I don't think you will be willing to put yourself to the trouble of compiling it.


Preference 2:
Is it possible to install gvim on a usb-stick.

Of course. Install from Steve Hall's installer as above, but instead of "My Documents\Vim", install under, for instance, "Q:\Vim" if Q: is your USB stick. Again, I don't know whether it will be necessary to create Q:\Vim first.

If so then I can install it at my home PC on the usb-stick and then use it at work

You may miss some things which only exist if they are set in the registry, for instance the "Edit with Vim" right-click menu; but I think the installation on the stick will be usable. You may have to create, let's say, a Q:\Home directory and set your HOME directory to it before starting Vim: for instance, by creating a GVIM.BAT file containing

set HOME=Q:\Home
Q:\Vim\vim70\%0 %1 %2 %3 %4 %5 %6 %7 %8 %9

(replace Q: by whatever is the root of the USB stick on the machine in 
question.)

You may also set up an identical copy of that same file with the name VIM.BAT if you have also installed the Console version of Vim.

With these settings, your vimrc (and gvimrc if any) will be in Q:\Home


Are there any other methods?

Rgds,
Eric

A final caveat: The VIMRUNTIME environment variable is best left unset in the environment (outside of Vim). You may or may not want to set the VIM variable but if it is set, it should be set to the Vim directory which is the parent of the vim70 installation folder for the current Vim 7.0 installation. It is not necessary to set it, but it is useful if you use the "Dos Box" command-line a lot: in that case, %VIM% (in any command given at the prompt) will resolve to wherever you set the VIM directory. Depending on your version of Windows, environment variables are set either in C:\AUTOEXEC.BAT or in "Control Panel => System => Advanced".


Best regards,
Tony.
--
Schapiro's Explanation:
        The grass is always greener on the other side -- but that's
because they use more manure.

Reply via email to