junegunn / vim-plug

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

plug.vim and init.lua loading issue? #1277

Closed tvendelin closed 4 months ago

tvendelin commented 4 months ago

I'm trying to set up vim-plug for Neovim using init.lua. I have installed plug.vim under $HOME/.local/share/nvim/site/autoload/plug.vim as your README suggests. Starting nvim results in an error message:

Error detected while processing $HOME/.config/nvim/init.lua:
E5113: Error while calling lua chunk: Vim:E117: Unknown function: #plug
stack traceback:
        [C]: in function 'Plug'
       $HOME/.config/nvim/init.lua:4: in main chunk
Press ENTER or type command to continue

When I try to call :PlugInstall, however, it doesn't result in an error, but neither does anything useful, telling me "No plugin to install".

The :echo globpath(&rtp, 'autoload/plug.vim') outputs

$HOME/.local/share/nvim/site/autoload/plug.vim

Manually sourcing with :source ~/.local/share/nvim/site/autoload/plug.vim didn't help either.

What am I missing here?


local vim = vim
local Plug = vim.fn['#plug']
vim.call('plug#begin', '~/.config/nvim/plugged')
  Plug('https://github.com/lifepillar/vim-gruvbox8.git')
vim.call('plug#end')
:version                                                                                                                                               
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

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

Run :checkhealth for more info
junegunn commented 4 months ago

It's plug#, not #plug. I recommend that you start from scratch following the official instruction in https://github.com/junegunn/vim-plug?tab=readme-ov-file#example-lua-configuration-for-neovim