mattn / vim-lsp-settings

Auto configurations for Language Server for vim-lsp
MIT License
1.3k stars 232 forks source link

Neovim on windows using msys2 bash #234

Open DancingQuanta opened 4 years ago

DancingQuanta commented 4 years ago

I am using nvim-qt (0.4.3) on windows installed from scoop (scoop install neovim') and set to use msys bash shell with the following settings at beginning of myinit.vim`

" Path for msys2 bash shell
set shell=C:\msys64\usr\bin\bash.exe

" msys2 bash flags
set shellcmdflag=-c

" Default value is (, but bash needs "
" Seem to work with msys2 and windows nvim-qt for !git
"  But the rest still fails
set shellxquote=(

" Paths will use / instead of \
set shellslash

" ensure MSYS2 binaries are available
let $PATH .= ';C:\msys64\bin'

I used the above settings in order to make the rest of my vimrc based on rafi/vim-config to work. My configuration have prevented this plugin from working because the filepaths used by this plugin have been treated so that the paths use backslash instead of forwardslash on windows. Then passing the paths to my bash shell instead of cmd.exe which causes the paths to lose backslash and appear as one continuous string. I am not sure where the backslash got lost though. If it is my bash shell not preserving the paths then the paths need to be treated differently. I am not sure of a solution for this particular case yet.

mattn commented 4 years ago

I'm not sure but If you use native executable not for msys2, it should use slash-ed path separators.

DancingQuanta commented 4 years ago

The executable nvim is native and works well with this plugin on its own using cmd. However, because the native executable have a flag 'has{'win32'}set to true which means that the paths are formatted forcmdbut my setup use msys64bash` which could not understand the slashes in the path. I use 'bash' in order to make the rest of my vimrc functional. I think this is a common issue with using vimrc written for linux OSes and I should find a solution.