簡體   English   中英

是否可以讓vim在Windows上使用正斜杠?

[英]Is it possible to make vim use forward slashes on windows?

Windows上的本地構建的ViM在文件路徑中使用反斜杠,包括完成,但如果我手動使用正斜杠(事實上所有Windows API都理解它們, cmd.exe是唯一的例外),並且反斜杠會導致各種問題,因為它們工作正常double作為轉義,“dwim”邏輯不起作用。 例如:

:vimgrep /Foo/ src/*

工作得很好,但是

:vimgrep /Foo/ src\*

沒有,因為\\逃脫了* 手動我只是寫正斜杠,但制表完成總是給我反斜杠,所以我必須一直改變它。

是否可以在默認情況下重新配置ViM以使用正斜杠(最好不重新編譯)?

這應該做你想要的

: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')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM