views:

66

answers:

2

Does gVim store files (specially preferences) in other directories rather than Program Files (for instance in %apps% like emacs)? If not, can I carry gVim in a USB frashdrive? (There's a portable version of Vim, but since it doesn't store anything in other folders I can't figure out it needs a portable version).

A: 

vim stores it's plugins and settings files by default in a folder relative to it's installation path.

You can override that location using $VIM and $VIMRUNTIME environment variables to point to the settings files.

From the vim editor use :help $VIM for documentation on this.

John Weldon
+1  A: 

To the best of my knowledge (and excluding temporary files and the bk option), Vim itself only creates a single file outside of its own directory: a _viminfo file in $HOME (your user directory) containing various information it can use if you reopen some file. You can read about it in more detail in the Vim help.

You can use your _vimrc to change the viminfo option to store it somewhere else.

Note that if you have added any plugins, some of those might also be saving stuff in your home directory - if you take a look at what is in that directory, it'll probably be fairly obvious which files you were dealing with. You'll have to check with the documentation for those plugins to see how to alter it to $VIM.

Michael Madsen