junegunn / vim-plug

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

[help] Vim-plug canot be loaded #1192

Open Henrai opened 2 years ago

Henrai commented 2 years ago

I get this when set up the vim plugin :

line   15:
E117: Unknown function: plugin#begin
line   16:
E492: Not an editor command: Plug 'vim-airline/vim-airline'
line   17:
E117: Unknown function: plugin#end
Press ENTER or type command to continue

And the result for :scriptname is this:

  1: /usr/share/vim/vimrc
  2: ~/.vimrc
  3: /usr/share/vim/vim82/filetype.vim
  4: /usr/share/vim/vim82/ftplugin.vim
  5: /usr/share/vim/vim82/indent.vim
  6: /usr/share/vim/vim82/syntax/syntax.vim
  7: /usr/share/vim/vim82/syntax/synload.vim
  8: /usr/share/vim/vim82/syntax/syncolor.vim
  9: /usr/share/vim/vim82/plugin/getscriptPlugin.vim
 10: /usr/share/vim/vim82/plugin/gzip.vim
 11: /usr/share/vim/vim82/plugin/logiPat.vim
 12: /usr/share/vim/vim82/plugin/manpager.vim
 13: /usr/share/vim/vim82/plugin/matchparen.vim
 14: /usr/share/vim/vim82/plugin/netrwPlugin.vim
 15: /usr/share/vim/vim82/plugin/rrhelper.vim
 16: /usr/share/vim/vim82/plugin/spellfile.vim
 17: /usr/share/vim/vim82/plugin/tarPlugin.vim
 18: /usr/share/vim/vim82/plugin/tohtml.vim
 19: /usr/share/vim/vim82/plugin/vimballPlugin.vim
 20: /usr/share/vim/vim82/plugin/zipPlugin.vim

It seems that the vim-plugin is not loaded at all. I apply chmod 777 to both .vim and .vim/autoload folder. Do we have any suggestions to manually load the plugin?

Thanks!

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 12 2022 04:26:50)
Stephan-MC commented 2 years ago

had the same problem but later found the solution. check this out

junegunn commented 2 years ago

Did you follow this instruction to install vim-plug?

Stephan-MC commented 2 years ago

Did you follow this instruction to install vim-plug?

Yes. But it has a little bug with vim 8+ and I found a possible solution

junegunn commented 2 years ago

it has a little bug

There is no bug. If you put plug.vim file in the right autoload directory, Vim will automatically load it when you run plug#begin, and that's the whole point of autoload. No manual sourcing is required.

Stephan-MC commented 2 years ago

I use vim on windows 10 and vim 9’.0 and I usually receive and error of function plug#begin not defined or something similar to that. And it caused some plugins not to function properly. I had to tweak my plug.vim to fix this.

Sent from my iPhone

On 27 Aug 2022, at 02:57, Junegunn Choi @.***> wrote:

 it has a little bug

There is no bug. If you put plug.vim file in the right autoload directory, Vim will automatically load it when you run plug#begin, and that's the whole point of autoload. No manual sourcing is required.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

azak-azkaran commented 1 year ago

I needed to set set runtimepath+=~/.vim in my vimrc before plug#begin because the autoload folder was not loaded

terriblemoment0836x commented 5 months ago

@azak-azkaran thanks, this worked for me.