Home » Questions » Computers [ Ask a new question ]

gVIM breaks symlinks on windows?

gVIM breaks symlinks on windows?

I'm trying to keep my gVIM config in centralized place. For this, i have done

Asked by: Guest | Views: 232
Total answers/comments: 2
Guest [Entry]

"Vim is supposed to handle this correctly by default. (:help backupcopy)

By default, on non-unix platforms, backupcopy is set to ""auto"". It will normally rename the file and write a new changed file when you save, but should modify the original file if the original file is a link or has a resource fork, etc.

Several possibilities:

Your version of vim does not recognize the file is a symlink.
You've set backupcopy or a related variable (breaksymlink?) to override default behavior.

I'd be surprised if it's 1, since you're dealing with a recent version of vim. Does this happen if you have an empty .vimrc?"
Guest [Entry]

"The user xaizek suggested an workaround in the comments of a related question I asked: Symlink to .vimrc on windows makes file readonly upon write. Why?. I've adopted his solution, but made the $MYVIMRC assignment conditional because I use both Windows and OSX systems:

So, in my Windows ~/.vimrc file I have:

source /path/to/shared/vimrc

Then, in the shared .vimrc file I have:

if has(""win32"")
let $MYVIMRC='~/path/to/shared/.vimrc'
endif"