History Report a problem
Article Edit this page Discussion

Single config file for Vim on Windows with Cygwin

From Vim Tips Wiki

(Redirected from VimTip939)
Jump to: navigation, search
 

Tip 939Previous TipNext Tip

Created: June 1, 2005 Complexity: basic Author: Lee Savidge Minimum version: 5.7 Karma: 19/13 Imported from: Tip#939


I got really bored of editing multiple vimrc files when I wanted to change mine. So, after installing cygwin under Windows I added an environment variable which set HOME to be c:\cygwin\home\username. Vim/GVim in Windows reads that variable if it is set and notes that the config file to read is the one I have in my cygwin directory. Also, because Vim/GVim under Windows understands that the config files could be called either .vimrc or _vimrc it doesn't require any other change. Now when either Vim in cygwin or Vim/GVim in Windows loads, they both use the same config files. This assumes that your config files can work under either environment as mine do.

[edit] Comments

Another option (if for some reason you don't want to change your Windows HOME var) is to create a vimrc file in your Windows home with the following lines:

source c:/cygwin/home/username/_vimrc
set runtimepath+=c:/cygwin/home/username/.vim

I think if you have installed cygwin, you can use the following method: under cygwin:

$ cd ~
$ ln -s /path/to/windows/_vimrc .vimrc

and by this way, we can use the same vimrc. Don't forget we can use " if has('win32') ..." to write config for different environment.


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Terminator Wiki
Legend of Zelda Wiki
Flash Gordon
Everquest II Wiki
Yo-Yo Wiki
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions


Vote for featured Wikia!

Send this article to a friend
"Single config file for Vim on Windows with Cygwin"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation