In (g)vim on Windows I can use :source \Program\ Files\ (x86)\Vim\vim81\msvim.vim to source the script for the Windows settings. Vim suggested the syntax with leading backslash when I found it in some menu.

But when I add to my ~/.vimrc

source \Program\ Files\ (x86)\Vim\vim81\msvim.vim

It does not work. I am not sure, when and where I need backslashes as path separator and to escape spaces, parentheses or other backslashes.

1 Answer 1


Use :runtime, it'll look into the directories specified by 'runtimepath' which should contain $VIMRUNTIME by default -- which should be C:/Program files (x86)/Vim/vim81 in your case.

Regarding slashes and backslashes, I never use backslashes, even on Windows with vim, nor in programs I develop (without the win32 API and the likes). They have too many side effects, starting with the need to double them (when they are required as characters and not as escaping signs).

BTW, are you really sure you want to source mswin.vim?

  • I am not sure. I created a own .vimrc and now the default one is no longer loaded and some features were not working as expected, e.g. visual mode. It looked like I wanted msvim, but then I have other issues, like a non-working backspace (similar to vi-mode). I am actually searching some config, that makes vim on Windows behave like the standard vim as it is packaged in different Linux distributions.
    – allo
    Commented Jun 16, 2019 at 10:59
  • If you want our Vim to behave like it does on *nix installation, you definitively do not want to load mswin.vim. Make sure you haven't triggered the compatible mode. Regarding backspace and other things, check :h 'backspace' (quotes are mandatory for vim options) and :h options Commented Jun 16, 2019 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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