1

I watched tons of vim setup videos, for example this is last one and this person claims it takes 10 seconds to setup vim anywhere. He just opens vimrc file and it immediately installs all the plugins (time 9:09). When I open this vimrc file I just get bunch of errors, nothing gets installed. How do I make it work? What is the secret?

enter image description here

4
  • 1
    Welcome to Vi and Vim!
    – filbranden
    Aug 19 '20 at 23:19
  • if you restart vim (assuming on the first start vim-plug is downloaded and installed) and do :PlugInstall, would it install plugins needed?
    – Maxim Kim
    Aug 20 '20 at 7:08
  • I remember I had this problem when I used vim-plug. I ended up using 2-step approach: 1) on the first start install vim-plug as in mentioned vimrc, message to "restart vim and do :PlugInstall" then call :finish to stop loading vimrc. 2) restart vim and do what was messaged in 1)
    – Maxim Kim
    Aug 20 '20 at 7:11
  • 1
    and pls link you vimrc too
    – Maxim Kim
    Aug 20 '20 at 7:15
0

The Unknown function: plug#begin error seems to indicate that vim-plug wasn't properly installed.

You can follow the instructions in here to install it:

https://github.com/junegunn/vim-plug#installation

In particular, you should have a file named ~/.vim/autoload/plug.vim in your system after you install it successfully. If you do have that file, then Vim should be able to find the plug#begin function when it's called from your vimrc.

4
  • Actually, it looks like the linked vimrc tries to download that file using curl. Maybe there's an error above the ones you pasted. Or maybe not, since it might have been silenced... Do you have curl available on your machine? That might explain why that part fails...
    – filbranden
    Aug 20 '20 at 0:21
  • Hi, yes I have both ~/.vim/autoload/plug.vim and curl... so I have no idea what is the reason
    – YohanRoth
    Aug 20 '20 at 4:37
  • 1
    @YohanRoth Does your vimrc actually match the one from that link? It's complaining about plug#begin from line 2, but the linked vimrc has that call on line 10...
    – filbranden
    Aug 20 '20 at 10:25
  • Please post output of vim --version, please edit your question to do so. Include the actual contents of your vimrc. Can you show inside your ~/.vim/autoload/plug.vim a few lines, make sure there's a plug#begin function defined in there as expected?
    – filbranden
    Aug 20 '20 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.