I don’t like Vimball files in Vim but more and more plugins use Vimball to install themselves.
A month ago I installed a 64 bits OS and moved my vimfiles directory to c:\users\”my-name”
No problem. Everything works fine.
Today I wanted update a plugin (which is now in Vimball).
After sourcing the plugin (:so %)
I received a lot of errors:
Error detected while processing function vimball#Vimvall..vimball#VimballHome:
E739: Cannot create directory C:/Progra~1/Vim/vimfiles
Error detected while processing function vimball# Vimball..<SNR>119_ChgDir:
E344: Can't find directory "C:\Progra~1\Vim\vimfiles in cdpath
E472: Command failed
…and so a whole page more of these kind of errors.
What’s happening and how can I resolve it?
Vimballs are extracted into the first existing directory on
'runtimepath'; based on your output, is looks like Vim doesn’t recognize the location where you moved your vimfiles to, and instead defaults to the system-wideC:/Progra~1/Vim/vimfileslocation, which probably is protected by Windows permissions, thereby causing the errors.Check the output of
:set runtimepath?; the first component should be yourC:\Users\my-name\vimfiles; if it isn’t, you need to make Vim include it, either via external means (e.g. setting theHOMEenvironment variable), or directly in your~/.vimrcwith:set runtimepath=.... See:help runtimepathfor details.Also, check for
g:vimball_home; this Vimball configuration overrides the default logic.As a workaround (not a solution), you can pass a custom install directory to the
:UseVimballcommand.