tags:

views:

814

answers:

4

I just installed Cygwin on my work machine and would like to use the .vimrc file I use on my Linux box at home.

  • Is that possible, or does it need to have Cygwin-specific settings?
  • Where would I put the .vimrc file?

I'm a little unsure of what directory I'm being dropped into at the bash prompt under Cygwin, but I think I'd create a subdirectory called .vim there, right?

+5  A: 

1) Yes it is possible. It doesnt need any cygwin specific settings, though you can add some windows specific ones. Just make sure to install vi (vim gvim equivalent) properly.

2) the same place as on *nix -- user home directory

vehomzzz
Your cygwin ~ directory (at least by default on xp) is c:\documents and settings\username
stonemetal
I believe the default installion use: c:\cygwin\home\<username>
Amro
+1  A: 

Some parts of file system of Cygwin use your "host" file system as its own. Within cygwin, there is a user home directory (which actually resides under your "Documents and Settings/Username" folder), so you should place it there.

Just place your .vimrc somewhere you know how to access via cygwin and do a

directory/you/know$ cp .vimrc ~/

It will work--at least worked with default vim on my Cygwin installation several months ago.

Pavel Shved
A: 

I don't see any reason why your Linux ~/.vimrc should not work in your cygwin install.

To go to your home directory in cygwin,
cd ~
or
cd $HOME

In Windows, you can use WinSCP to connect to your Linux box, open your Linux .vimrc in the WinSCP default editor, copy the contents. Then switch to the Cgywin terminal and type
getclip > ~/.vimrc

Start vi/vim to see if your new settings have taken effect:
vi

Dragos Toader
A: 

Beware one thing: there is a Cygwin port of vim, and a native win32 port of vim. Both have their advantages and their flaws when dialogue with cygwin or native-win32 applications is concerned.

A category on vim.wikia is dedicated to cygwin related tips.

Luc Hermitte