vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

Not an editor command: PlugInstall when installing via cli

Open tim-hilt opened this issue 2 years ago • 9 comments

I tried to build a minimal, dockerized environment that let's me try out vim-packages without altering my local installation. The Dockerfile basically copies over my nvim-configuration and should install my packages during the image-building-step. These are the relevant parts from the Dockerfile:

USER dev

ENV HOME /home/dev

COPY --chown=dev:dev . /home/dev/.config/nvim

...

WORKDIR /home/dev

RUN curl -sfLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
RUN nvim -es -u /home/dev/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "qa"

Unfortunately, I couldn't get the last line to succeed. If I run it with the -V-flag at the end, it tells me

E492: Not an editor command: PlugInstall

You can find the Dockerfile and the rest of my config here.


:version
NVIM v0.5.0
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextr
a -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostic
s-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim/src/neovim-0.5.0/build/config -I/buil
d/neovim/src/neovim-0.5.0/src -I/usr/include -I/build/neovim/src/neovim-0.5.0/build/src/nvim/auto -I/build/neovim/src/neovim-0.5.0/build/include
Compiled by builduser

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
  • Type:
    • [x] Bug
    • [ ] Enhancement
    • [ ] Feature Request
    • [ ] Question
  • OS:
    • [ ] All/Other
    • [x] Linux
    • [ ] OS X
    • [ ] Windows
  • Vim:
    • [ ] Terminal Vim
    • [ ] GVim
    • [x] Neovim

tim-hilt avatar Aug 23 '21 15:08 tim-hilt

I'm running into this same issue on Ubuntu as well:

lsb_release -a 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

My $HOME/.config/nvim/init.vim file:

syntax on

" Auto install vim-plug
let data_dir = has("nvim") ? stdpath("data") . "/site" : "~/.vim"

if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute "!curl -fLo ".data_dir."/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

It downloads plug.vim into $HOME/.local/share/nvim/site/autoload, but I get this error upon once it's downloaded:

Error detected while processing VimEnter Autocommands for "*":
E492: Not an editor command: PlugInstall --sync | source $MYVIMRC
Press ENTER or type command to continue

When I check my runtime path:

echo &rtp
" edited $HOME in place of my user's dir

$HOME/.config/nvim,/etc/xdg/xdg-ubuntu/nvim,/etc/xdg/nvim,$HOME/.local/share/nvim/site,/usr/shar
e/ubuntu/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/var/lib/snapd/desktop/nvim/site,/var/lib/sna
pd/desktop/nvim/site,/tmp/.mount_nvim0cRRmT/usr/share/nvim/runtime,/tmp/.mount_nvim0cRRmT/usr/share/nvim/runtime
/pack/dist/opt/matchit,/tmp/.mount_nvim0cRRmT/usr/lib/nvim,/var/lib/snapd/desktop/nvim/site/after,/var/lib/snapd
/desktop/nvim/site/after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/usr/share/ubuntu/nvim/site
/after,$HOME/.local/share/nvim/site/after,/etc/xdg/nvim/after,/etc/xdg/xdg-ubuntu/nvim/after,/home/hectr
on/.config/nvim/after

Running nvim -v:

nvim -v
NVIM v0.5.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az242-526

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Any ideas here?

hectron avatar Aug 28 '21 18:08 hectron

Update:

For my issue, everything was in the right place, but I never called plug#begin.

Once I did this further down in my init.vim, it worked fine:

let g:plug_home = stdpath("data") . "/plugged"

call plug#begin(plug_home)

hectron avatar Aug 28 '21 18:08 hectron

For anyone having this problem still, I solved mine putting the code below just before the begin call in my init.vim( as suggested on the readme)

And you can try making " :so % " after saving the file.

let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

Mert18 avatar Aug 30 '21 18:08 Mert18

@hectron @Mert18 My issue is with building the Docker-image. Have you tried it with the procedure I described above? All files to reproduce are linked to in the issue-description.

tim-hilt avatar Aug 30 '21 19:08 tim-hilt

To clarify: This is not an issue with setting up vim-plug or with nvim-configuration in general - it's about the automatic installation of vim-plug from a Dockerfile.

tim-hilt avatar Aug 30 '21 19:08 tim-hilt

@tim-hilt -- Have you confirmed trying to include the following in your init.vim file?

let g:plug_home = stdpath("data") . "/plugged"

call plug#begin(plug_home)

As I referenced to above, I didn't have the snippet above in my init.vim which caused the PlugInstall command to not be available.

hectron avatar Aug 30 '21 19:08 hectron

@hectron Yes, confirmed. The output of the last build step is the following:

Step 11/12 : RUN nvim -es -u /home/dev/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "qa" -V
 ---> Running in 10616f65f268
chdir(/home/dev)
chdir(/home/dev/.config/nvim)
chdir(/home/dev)
sourcing "/home/dev/.config/nvim/init.vim"
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/1 /home/$USER/.config/nvim/config/plug.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 2: could not source "/home//.config/nvim/config/plug.vim"
Error detected while processing /home/dev/.config/nvim/init.vim:
line    2:
E484: Can't open file /home//.config/nvim/config/plug.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/2 /home/$USER/.config/nvim/config/misc.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 3: could not source "/home//.config/nvim/config/misc.vim"
line    3:
E484: Can't open file /home//.config/nvim/config/misc.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/3 /home/$USER/.config/nvim/config/autostart.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 4: could not source "/home//.config/nvim/config/autostart.vim"
line    4:
E484: Can't open file /home//.config/nvim/config/autostart.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/4 /home/$USER/.config/nvim/config/keymaps.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 5: could not source "/home//.config/nvim/config/keymaps.vim"
line    5:
E484: Can't open file /home//.config/nvim/config/keymaps.vim
line   13:
E5108: Error executing lua [string ":lua"]:1: attempt to concatenate a nil value
finished sourcing /home/dev/.config/nvim/init.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/filetype.vim"
not found in 'runtimepath': "ftdetect/*.vim"
not found in 'packpath': "pack/*/start/*/ftdetect/*.vim"
not found in 'packpath': "start/*/ftdetect/*.vim"
not found in 'runtimepath': "ftdetect/*.lua"
not found in 'packpath': "pack/*/start/*/ftdetect/*.lua"
not found in 'packpath': "start/*/ftdetect/*.lua"
finished sourcing /usr/share/nvim/runtime/filetype.vim
not found in 'packpath': "pack/*/start/*/filetype.vim"
not found in 'packpath': "start/*/filetype.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/ftplugin.vim"
finished sourcing /usr/share/nvim/runtime/ftplugin.vim
not found in 'packpath': "pack/*/start/*/ftplugin.vim"
not found in 'packpath': "start/*/ftplugin.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/indent.vim"
finished sourcing /usr/share/nvim/runtime/indent.vim
not found in 'packpath': "pack/*/start/*/indent.vim"
not found in 'packpath': "start/*/indent.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/syntax/syntax.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
line 19: sourcing "/usr/share/nvim/runtime/syntax/synload.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
line 21: sourcing "/usr/share/nvim/runtime/syntax/syncolor.vim"
finished sourcing /usr/share/nvim/runtime/syntax/syncolor.vim
continuing in /usr/share/nvim/runtime/syntax/synload.vim
not found in 'packpath': "pack/*/start/*/syntax/syncolor.vim"
not found in 'packpath': "start/*/syntax/syncolor.vim"
finished sourcing /usr/share/nvim/runtime/syntax/synload.vim
continuing in /usr/share/nvim/runtime/syntax/syntax.vim
Executing FileType Autocommands for "*"
autocommand exe "set syntax=" . expand("<amatch>")

Executing Syntax Autocommands for "*"
autocommand call s:SynSet()

finished sourcing /usr/share/nvim/runtime/syntax/syntax.vim
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "start/*"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/gzip.vim"
finished sourcing /usr/share/nvim/runtime/plugin/gzip.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/health.vim"
finished sourcing /usr/share/nvim/runtime/plugin/health.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/man.vim"
finished sourcing /usr/share/nvim/runtime/plugin/man.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/matchit.vim"
not found in 'packpath': "pack/*/start/matchit"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
chdir(/home/dev)
chdir(/home/dev/.config/nvim)
chdir(/home/dev)
chdir(/home/dev)
chdir(/etc/xdg/nvim)
chdir(/home/dev)
chdir(/home/dev)
chdir(/home/dev/.local/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/local/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/pack/dist/opt)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/pack/dist/opt/matchit/plugin)
chdir(/home/dev)
line 3: sourcing "/usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim"
finished sourcing /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
continuing in /usr/share/nvim/runtime/plugin/matchit.vim
finished sourcing /usr/share/nvim/runtime/plugin/matchit.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/matchparen.vim"
finished sourcing /usr/share/nvim/runtime/plugin/matchparen.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/netrwPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/netrwPlugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/rplugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/rplugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/shada.vim"
finished sourcing /usr/share/nvim/runtime/plugin/shada.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/spellfile.vim"
finished sourcing /usr/share/nvim/runtime/plugin/spellfile.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tarPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tarPlugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tohtml.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tohtml.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tutor.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tutor.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/zipPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/zipPlugin.vim
not found in 'packpath': "plugin/**/*.lua"
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "start/*"
not found in 'runtimepath': "plugin/**/*.vim"
not found in 'packpath': "pack/*/start/*/plugin/**/*.vim"
not found in 'packpath': "start/*/plugin/**/*.vim"
not found in 'runtimepath': "plugin/**/*.lua"
not found in 'packpath': "pack/*/start/*/plugin/**/*.lua"
not found in 'packpath': "start/*/plugin/**/*.lua"
Executing BufEnter Autocommands for "*"
autocommand sil call s:LocalBrowse(expand("<amatch>"))

Error detected while processing command line:
E492: Not an editor command: PlugInstallThe command '/bin/sh -c nvim -es -u /home/dev/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "qa" -V' returned a non-zero code: 1

Please take a look at the updated Dockerfile, just to be clear that there's nothing wrong with that

tim-hilt avatar Sep 01 '21 18:09 tim-hilt

@hectron Yes, confirmed. The output of the last build step is the following:

Step 11/12 : RUN nvim -es -u /home/dev/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "qa" -V
 ---> Running in 10616f65f268
chdir(/home/dev)
chdir(/home/dev/.config/nvim)
chdir(/home/dev)
sourcing "/home/dev/.config/nvim/init.vim"
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/1 /home/$USER/.config/nvim/config/plug.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 2: could not source "/home//.config/nvim/config/plug.vim"
Error detected while processing /home/dev/.config/nvim/init.vim:
line    2:
E484: Can't open file /home//.config/nvim/config/plug.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/2 /home/$USER/.config/nvim/config/misc.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 3: could not source "/home//.config/nvim/config/misc.vim"
line    3:
E484: Can't open file /home//.config/nvim/config/misc.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/3 /home/$USER/.config/nvim/config/autostart.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 4: could not source "/home//.config/nvim/config/autostart.vim"
line    4:
E484: Can't open file /home//.config/nvim/config/autostart.vim
Executing command: "set nonomatch; vimglob() { while [ $# -ge 1 ]; do echo "$1"; shift; done }; vimglob >/tmp/nvimdjFa49/4 /home/$USER/.config/nvim/config/keymaps.vim"

chdir(/home/dev)
chdir(/home//.config/nvim/config)
chdir(/home/dev)
line 5: could not source "/home//.config/nvim/config/keymaps.vim"
line    5:
E484: Can't open file /home//.config/nvim/config/keymaps.vim
line   13:
E5108: Error executing lua [string ":lua"]:1: attempt to concatenate a nil value
finished sourcing /home/dev/.config/nvim/init.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/filetype.vim"
not found in 'runtimepath': "ftdetect/*.vim"
not found in 'packpath': "pack/*/start/*/ftdetect/*.vim"
not found in 'packpath': "start/*/ftdetect/*.vim"
not found in 'runtimepath': "ftdetect/*.lua"
not found in 'packpath': "pack/*/start/*/ftdetect/*.lua"
not found in 'packpath': "start/*/ftdetect/*.lua"
finished sourcing /usr/share/nvim/runtime/filetype.vim
not found in 'packpath': "pack/*/start/*/filetype.vim"
not found in 'packpath': "start/*/filetype.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/ftplugin.vim"
finished sourcing /usr/share/nvim/runtime/ftplugin.vim
not found in 'packpath': "pack/*/start/*/ftplugin.vim"
not found in 'packpath': "start/*/ftplugin.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/indent.vim"
finished sourcing /usr/share/nvim/runtime/indent.vim
not found in 'packpath': "pack/*/start/*/indent.vim"
not found in 'packpath': "start/*/indent.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/syntax/syntax.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
line 19: sourcing "/usr/share/nvim/runtime/syntax/synload.vim"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/syntax)
chdir(/home/dev)
line 21: sourcing "/usr/share/nvim/runtime/syntax/syncolor.vim"
finished sourcing /usr/share/nvim/runtime/syntax/syncolor.vim
continuing in /usr/share/nvim/runtime/syntax/synload.vim
not found in 'packpath': "pack/*/start/*/syntax/syncolor.vim"
not found in 'packpath': "start/*/syntax/syncolor.vim"
finished sourcing /usr/share/nvim/runtime/syntax/synload.vim
continuing in /usr/share/nvim/runtime/syntax/syntax.vim
Executing FileType Autocommands for "*"
autocommand exe "set syntax=" . expand("<amatch>")

Executing Syntax Autocommands for "*"
autocommand call s:SynSet()

finished sourcing /usr/share/nvim/runtime/syntax/syntax.vim
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "start/*"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/gzip.vim"
finished sourcing /usr/share/nvim/runtime/plugin/gzip.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/health.vim"
finished sourcing /usr/share/nvim/runtime/plugin/health.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/man.vim"
finished sourcing /usr/share/nvim/runtime/plugin/man.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/matchit.vim"
not found in 'packpath': "pack/*/start/matchit"
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
chdir(/home/dev)
chdir(/home/dev/.config/nvim)
chdir(/home/dev)
chdir(/home/dev)
chdir(/etc/xdg/nvim)
chdir(/home/dev)
chdir(/home/dev)
chdir(/home/dev/.local/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/local/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/site)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/pack/dist/opt)
chdir(/home/dev)
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/pack/dist/opt/matchit/plugin)
chdir(/home/dev)
line 3: sourcing "/usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim"
finished sourcing /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
continuing in /usr/share/nvim/runtime/plugin/matchit.vim
finished sourcing /usr/share/nvim/runtime/plugin/matchit.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/matchparen.vim"
finished sourcing /usr/share/nvim/runtime/plugin/matchparen.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/netrwPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/netrwPlugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/rplugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/rplugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/shada.vim"
finished sourcing /usr/share/nvim/runtime/plugin/shada.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/spellfile.vim"
finished sourcing /usr/share/nvim/runtime/plugin/spellfile.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tarPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tarPlugin.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tohtml.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tohtml.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/tutor.vim"
finished sourcing /usr/share/nvim/runtime/plugin/tutor.vim
chdir(/home/dev)
chdir(/usr/share/nvim/runtime/plugin)
chdir(/home/dev)
sourcing "/usr/share/nvim/runtime/plugin/zipPlugin.vim"
finished sourcing /usr/share/nvim/runtime/plugin/zipPlugin.vim
not found in 'packpath': "plugin/**/*.lua"
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "start/*"
not found in 'runtimepath': "plugin/**/*.vim"
not found in 'packpath': "pack/*/start/*/plugin/**/*.vim"
not found in 'packpath': "start/*/plugin/**/*.vim"
not found in 'runtimepath': "plugin/**/*.lua"
not found in 'packpath': "pack/*/start/*/plugin/**/*.lua"
not found in 'packpath': "start/*/plugin/**/*.lua"
Executing BufEnter Autocommands for "*"
autocommand sil call s:LocalBrowse(expand("<amatch>"))

Error detected while processing command line:
E492: Not an editor command: PlugInstallThe command '/bin/sh -c nvim -es -u /home/dev/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "qa" -V' returned a non-zero code: 1

Please take a look at the updated Dockerfile, just to be clear that there's nothing wrong with that

There seems to be a lot going wrong here, and I will guess it has a lot to do with that double slash. I am working on installing through docker build again too and I remember the first time it took me quite a while to get it working, most of which was spent sorting out the errors in this log. line 2: could not source "/home//.config/nvim/config/plug.vim" this line for instance should be the reason it is saying that PlugInstall is not a recognized command no?

TheApeMachine avatar Nov 29 '21 00:11 TheApeMachine

Also I ended up using the below in the Dockerfile, and removing the auto-install bit in the .vimrc completely.

RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \
	&& vim +PlugInstall +qall

TheApeMachine avatar Nov 29 '21 01:11 TheApeMachine

Possibly related: https://github.com/junegunn/vim-plug/issues/1270#issuecomment-2019290236

junegunn avatar Mar 30 '24 11:03 junegunn