junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
34.03k stars 1.93k forks source link

PlugInstall fails immediatelly after launch #832

Closed silvanocerza closed 5 years ago

silvanocerza commented 5 years ago

I'm trying to use vim-plug on Windows but it fails right away when launching :PlugInstall. I've tried running some other commands and :PlugUpgrade fails like so:

[vim-plug] Error upgrading vim-plug: 'C:\Users\The' is not recognized as an internal or external command,^@operable prog
ram or batch file.^@
Press ENTER or type command to continue

My user directory is C:\Users\The Alien so probably it's an issue with spaces in paths.


:version
NVIM v0.3.4
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.
exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG -DMIN_LOG_LEVEL=3 /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_D
EPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_
FROM -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/neovim/.deps/usr/include -IC:/projects/neo
vim/build/src/nvim/auto -IC:/projects/neovim/build/include
Compiled by appveyor@APPVYR-WIN

Features: -acl +iconv -jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info
Press ENTER or type command to continue
junegunn commented 5 years ago

Fixed the issue for PlugUpgrade in 518a356. Thanks for the report.

But I'm not sure why you're running into the problem during PlugInstall since we already escape the arguments properly.

https://github.com/junegunn/vim-plug/blob/518a3566c32cec35c68749c765127ef6f7703630/plug.vim#L1353-L1358

silvanocerza commented 5 years ago

Thanks for the update, I'll be able to verify if it works later today. I'll let you know if it worked.

silvanocerza commented 5 years ago

I tried the new version but seems like nothing has changed. PlugUpgrade fails the same way as before with the same error, PlugInstall seems to work but it doesn't actually install anything. This is the output:

[xxxxxxxxxxxxxx]

- Finishing ... Done!
x nerdtree-git-plugin:
    OK
x fzf:
    OK
x vim-better-whitespace:
    OK
x vim-devicons:
    OK
x supertab:
    OK
x vim-airline:
    OK
x vim-airline-themes:
    OK
x vim-bufkill:
    OK
x vim-gitgutter:
    OK
x nerdtree:
    OK
x fzf.vim:
    OK
x vim-tmux-navigator:
    OK
x vim-instant-markdown:
    OK
x gruvbox:
    OK

This is my init.vim file in case it might help:

call plug#begin('~/AppData/Local/nvim/plugged')

" Fuzzy finder
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'

" Color scheme
Plug 'morhetz/gruvbox'

" Auto complete
Plug 'ervandew/supertab'

" Markdown
Plug 'suan/vim-instant-markdown'

" Status line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

" Trim whitespaces
Plug 'ntpeters/vim-better-whitespace'

" Navigation between vim splits and tmux panes
Plug 'christoomey/vim-tmux-navigator'

" Nerdtree
Plug 'scrooloose/nerdtree'

" git
Plug 'xuyuanp/nerdtree-git-plugin'
Plug 'airblade/vim-gitgutter'

" Cool icons
Plug 'ryanoasis/vim-devicons'

" Kills buffers without closing windows
Plug 'qpkorr/vim-bufkill'

" Initializes plugin system
call plug#end()

" -------------- Various Settings --------------

" color scheme settings
let g:gruvbox_contrast_dark = 'hard'
let g:gruvbox_italic = 1
set background=dark
set termguicolors

" Color scheme
syntax enable
" colorscheme gruvbox

" Sets colored line at specified column
let &colorcolumn="81,".join(range(121,999),",")

" Trims whitespace on save
autocmd BufWritePost * StripWhitespace

" Disables vim backup and swap file
set nobackup
set noswapfile

" Reloads file if it's modified by another source
set autoread

" Clipboard that makes sense
set clipboard+=unnamedplus

" Shows line numbers
set number
set relativenumber

" Number of spaces used when tab is read from a file
set tabstop=4

" Number of spaces used when tab is pressed
set softtabstop=4

" Expands tab to spaces
set expandtab

" Number of spaces to use for autoindent
set shiftwidth=4

" Copies indent from the previous line
set autoindent
set copyindent

" Draws an horizontal line on current line
set cursorline

" Highlights matching parens
set showmatch

" Highlights matching searched chars
set hlsearch

" Shows spaces and various non visible chars
" set listchars=tab:?\ ,space:�,trail:�
set list

" New splits are added below current window, this is useful mainly for previews
set splitbelow

" Enables mouse selection
set mouse=a

" Neovim python versions
let g:python3_host_prog = 'C:\Python37\python.exe'

" NERDTree settings
let g:webdeviconsnerdtreegitpluginforcevalign = 1
let g:NERDTreeShowHidden = 1
let g:NERDTreeIgnore = ['\.pyc$', '__pycache__', '\.qmlc$']
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'

" Airline settings
let g:airline_theme = 'gruvbox'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_left_sep = ' '
let g:airline_right_sep = ' '

" Closes autocomplete preview window when done
autocmd CompleteDone * silent! pclose!

" Git gutter settings
set signcolumn=yes

" Markdown settings
let g:instant_markdown_slow = 1
let g:instant_markdown_autostart = 0

" -------------- Key Mappings --------------

" Changes leader
let mapleader=';'

" Switches between C++ header and source
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>

" Turns off search highlight by pressing leader + space
nnoremap <leader><space> :nohlsearch<cr>

" Opens nerdtree with ctrl+n
map <C-n> :NERDTreeToggle<CR>

" Maps j+k to esc insert mode
imap jk <esc>

" Quick save and close
nmap <leader>w :w<CR>
nmap <leader>x :x<CR>
nmap <leader>q :q<CR>

" Switches buffers with tab
nmap <S-Tab> :bprevious!<CR>
nmap <Tab> :bnext!<CR>

" Closes current buffer
nnoremap <leader>bd :BD<CR>
nnoremap <C-p> :FZF<CR>
janlazo commented 5 years ago

batchfile filename is not escaped in s:bang, s:system, s:spawn.

silvanocerza commented 5 years ago

Seems like nothing has changed, the output is still the same and nothing is being downloaded.

Updated. Elapsed time: 0.145269 sec.
[xxxxxxxxxxxxxx]

- Finishing ... Done!
x nerdtree-git-plugin:
    OK
x fzf:
    OK
x vim-better-whitespace:
    OK
x vim-devicons:
    OK
x supertab:
    OK
x vim-airline:
    OK
x vim-airline-themes:
    OK
x vim-bufkill:
    OK
x vim-gitgutter:
    OK
x nerdtree:
    OK
x fzf.vim:
    OK
x vim-tmux-navigator:
    OK
x vim-instant-markdown:
    OK
x gruvbox:
    OK
janlazo commented 5 years ago

Is git in the shell's PATH when you run nvim? Did it create the plugged directory? I don't see anything in your init.vim that would cause vim-plug to fail installing plugins.

silvanocerza commented 5 years ago

Yes, git is in the PATH and the plugged directory is created.

If it helps I have installed only Python 3 and neither ruby or Python 2.

janlazo commented 5 years ago
diff --git a/plug.vim b/plug.vim
index bfafbfb..fc57c75 100644
--- a/plug.vim
+++ b/plug.vim
@@ -795,7 +795,8 @@ endfunction
 function! s:chsh(swap)
   let prev = [&shell, &shellcmdflag, &shellredir]
   if s:is_win
-    set shell=cmd.exe shellcmdflag=/c shellredir=>%s\ 2>&1
+    set shell=cmd.exe shellredir=>%s\ 2>&1
+    let &shellcmdflag = has('nvim') ? '/s /c' : '/c'
   elseif a:swap
     set shell=sh shellredir=>%s\ 2>&1
   endif

If you apply this patch, does it improve the situation? neovim's shellcmdflag differs from vim because of shellxquote.

silvanocerza commented 5 years ago

There's no change, same output as before.

janlazo commented 5 years ago

Master was updated recently. Any change?

silvanocerza commented 5 years ago

No change, same as before.

royAmmerschuber commented 5 years ago

Im having the same problem but with normal vim and gvim on windows

:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug  4 2019 21:06:12)
MS-Windows 64-bit GUI/console version with OLE support
Included patches: 1-1813
Compiled by stop_@LAPTOP-E7OHISR4
Huge version with GUI.  Features included (+) or not (-):
+acl                +cindent            +cursorshape        -farsi              +jumplist           +mksession          +path_extra         +ruby/dyn           -tag_old_static     +toolbar            +wildmenu
+arabic             +clientserver       +dialog_con_gui     +file_in_path       +keymap             +modify_fname       +perl/dyn           +scrollbind         -tag_any_white      +user_commands      +windows
+autocmd            +clipboard          +diff               +find_in_path       +lambda             +mouse              +persistent_undo    +signs              +tcl/dyn            +vartabs            +writebackup
+autochdir          +cmdline_compl      +digraphs           +float              +langmap            +mouseshape         -postscript         +smartindent        +termguicolors      +vertsplit          -xfontset
+autoservername     +cmdline_hist       +directx            +folding            +libcall            +multi_byte_ime/dyn +printer            +sound              +terminal           +virtualedit        -xim
+balloon_eval       +cmdline_info       -dnd                -footer             +linebreak          +multi_lang         +profile            +spell              -termresponse       +visual             +xpm_w32
+balloon_eval_term  +comments           -ebcdic             +gettext/dyn        +lispindent         +mzscheme/dyn       +python/dyn         +startuptime        +textobjects        +visualextra        -xterm_save
+browse             +conceal            +emacs_tags         -hangul_input       +listcmds           +netbeans_intg      +python3/dyn        +statusline         +textprop           +viminfo
++builtin_terms     +cryptv             +eval               +iconv/dyn          +localmap           +num64              +quickfix           -sun_workshop       -tgetent            +vreplace
+byte_offset        +cscope             +ex_extra           +insert_expand      +lua/dyn            +ole                +reltime            +syntax             +timers             +vtp
+channel            +cursorbind         +extra_search       +job                +menu               +packages           +rightleft          +tag_binary         +title              +wildignore
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL   -DFEAT_XPM_W32   -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG  /MD -DVIMDLL -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DGLOBAL_IME -DFEAT_GUI_MSWIN -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python37.dll\" -DFEAT_MZSCHEME -I "..\..\libs\racket-7.3\include" -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracketxxxxxxx.dll\" -DDYNAMIC_MZGC_DLL=\"libmzgcxxxxxxx.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl530.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=26 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby260.dll\" -DFEAT_HUGE /Fd.\ObjDXOULYHTRZVAMD64/ /Zi
Linking: link  /nologo /opt:ref /LTCG:STATUS /d2:-AllowCompatibleILVersions /HIGHENTROPYVA:NO oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:AMD64 gdi32.lib version.lib
  winspool.lib comctl32.lib advapi32.lib shell32.lib netapi32.lib  /machine:AMD64  msvcrt.lib oleaut32.lib user32.lib  /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python37.lib   "..\..\libs\IronTcl\x64\lib\tclstub86.lib" winmm.lib WSock32.lib .\xpm\x64\lib-vc14\libXpm.lib /PDB:vim64.pdb -debug
Press ENTER or type command to continue
janlazo commented 5 years ago

https://github.com/junegunn/vim-plug/pull/860 should fix this if it's not an environment problem or a filepath problem with ~.

royAmmerschuber commented 5 years ago

that seems to have fixed it