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

[Neovim] Tutorial assumes an XDG environment even if ~/.local/share/nvim/site is not in runtimepath

Open panjf2000 opened this issue 4 years ago • 5 comments

Hi, I followed the tutorial and ran this command below:

# Neovim (~/.local/share/nvim/site/autoload)
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

, after which I got an error message when I tried to open a file with vim, image I've searched the Github issues for a solution before I submit this issue, #245 #812 , but I found that all means from those issues are either noneffective or too tricky, just wonder why this error would occur since I followed the instruments strictly and how to fix it in state, thanks!



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

panjf2000 avatar Sep 25 '20 07:09 panjf2000

This issue seems to be solved after I added this script into ~/.config/nvim/init.vim:

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

according to https://github.com/junegunn/vim-plug/wiki/tips#tips, although there was a new error message showing up: image

So I guess the root cause of the initial issue is due to the ~/.local/share/nvim/site/autoload/plug.vim not working?

panjf2000 avatar Sep 25 '20 07:09 panjf2000

Is ~/.local/share/nvim/site in your runtimepath?

janlazo avatar Sep 25 '20 21:09 janlazo

Sorry for the delay!

Is ~/.local/share/nvim/site in your runtimepath?

No, I don't think so.

panjf2000 avatar Oct 02 '20 09:10 panjf2000

That is strange. runtimepath should have it on Linux if running neovim without user config (via nvim -u NORC) unless XDG environment variables are set.

janlazo avatar Oct 03 '20 02:10 janlazo

Can confirm I had the same issue on my fresh arch install, no XDG set.

Fixed after moving plug.vim from ~/.local/share/nvim/autoload/plug.vim to ~/.config/nvim/autoload/plug.vim

nC3rtainity avatar Jan 18 '21 15:01 nC3rtainity

Should be fixed on the latest version of Neovim.

junegunn avatar Mar 30 '24 10:03 junegunn