7

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?

3
  • 4
    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, 2012 at 10:07
  • @xaizek: I've adopted your solution. No more annoying windows symlink stuff... Aug 31, 2012 at 13:30
  • 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, 2012 at 19:20

1 Answer 1

12

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .