Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've put my .vimrc file in a central location (dropbox folder, also a hg repository).

Under Windows 7, I've symlinked to it from my home folder (strangely enough I had to do it as an administrator, otherwise I got 'no permission'):

C:\users\Me>mklink .vimrc C:\users\me\dropbox\dotfiles\.vimrc

After fixing an overwrite issue by using set backupcopy=yes (found here: gVIM breaks symlinks on windows?), I have another issue. When I save the modified file, the real .vimrc (in my dropbox/dotfiles folder) gets a read-only flag as soon as I save it (using :w).

Why is this? How can I prevent this?

share|improve this question
3  
I can propose another way of solving symlink issue, which I use on Windows XP machines. Create _vimrc with one line source /path/to/real/vimrc and update $MYVIMRC variable in your real vimrc file, e.g. let $MYVIMRC='/path/to/real/vimrc'. Maybe this will solve your current issue. –  xaizek Aug 31 '12 at 10:07
    
@xaizek: I've adopted your solution. No more annoying windows symlink stuff... –  Rabarberski Aug 31 '12 at 13:30
    
@xaizek: if you put your suggestion in an answer, I'll accept it. –  Rabarberski Nov 8 '12 at 9:05
    
OK, just did it. I wasn't sure whether it's the right thing to do, since my comment doesn't really answer your question. –  xaizek Nov 9 '12 at 19:20

1 Answer 1

up vote 6 down vote accepted

I can propose another way of solving symlink issue, which I use on Windows XP machines or on Windows 7 without administrative rights.

Create _vimrc file with one line

source /path/to/real/vimrc

and update $MYVIMRC variable in your real vimrc file, e.g.

let $MYVIMRC='/path/to/real/vimrc'

Changing value of $MYVIMRC is useful for referring to correct vimrc file (for example in autocommands that reread it) on different systems.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.