這應該做你想做的
:set shellslash
幫助(:h shellslash
)複製下面然而
'shellslash' 'ssl' 'noshellslash' 'nossl'
'shellslash' 'ssl' boolean (default off)
global
{not in Vi} {only for MSDOS, MS-Windows and OS/2}
When set, a forward slash is used when expanding file names. This is
useful when a Unix-like shell is used instead of command.com or
cmd.exe. Backward slashes can still be typed, but they are changed to
forward slashes by Vim.
Note that setting or resetting this option has no effect for some
existing file names, thus this option needs to be set before opening
any file for best results. This might change in the future.
'shellslash' only works when a backslash can be used as a path
separator. To test if this is so use:
if exists('+shellslash')
注意的是,了 'shellslash' 打破一些外部程序,很多插件和shellescape ()函數。因此,如果您開始使用這些功能獲得奇怪的錯誤,請通過禁用該選項來查看它是否消失。如果插件...通知插件作者。 – Ben