Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Single config file for Vim on Windows with Cygwin
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Single config file for Vim on Windows with Cygwin
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{review}} {{TipImported |id=939 |previous=937 |next=941 |created=2005 |complexity=basic |author=Lee Savidge |version=5.7 |rating=19/13 |category1=Cygwin |category2= }} 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 <code>c:\cygwin\home\username</code>. 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. ==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: <pre> set runtimepath+=c:/cygwin/home/username/.vim source c:/cygwin/home/username/_vimrc </pre> ---- I think if you have installed cygwin, you can use the following method: under cygwin: <pre> $ cd ~ $ ln -s /path/to/windows/_vimrc .vimrc </pre> 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. ---- Be careful with setting $HOME to something else under Windows. A lot of apps rely on such variable as well. You may end up messing up another app`s settings. ----
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Navigation
(
view source
)
Template:Review
(
view source
)
Template:TipImported
(
view source
)
Follow on IG
TikTok
Join Fan Lab