vim-plug
vim-plug copied to clipboard
[Neovim] Tutorial assumes an XDG environment even if ~/.local/share/nvim/site is not in runtimepath
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
,
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
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:
So I guess the root cause of the initial issue is due to the ~/.local/share/nvim/site/autoload/plug.vim
not working?
Is ~/.local/share/nvim/site
in your runtimepath
?
Sorry for the delay!
Is
~/.local/share/nvim/site
in yourruntimepath
?
No, I don't think so.
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.
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
Should be fixed on the latest version of Neovim.