0

I've been following this video tutorial, to install some VIM plugins in order to change the text colors in my VIM editor, especially to make comments brighter color.

I've created .vimrc file. It looks like this:

  1
  2 set nocompatible     " Set compatibility to Vim only
  3
  4 set number    " Show line numbers
  5
  6 set wrap    " Automatically wrap text that extends beyond the screen length
  7
  8 set laststatus=2    " Show status bar
  9
 10 set encoding=utf-8     " Force encoding
 11
 12 " Call the .vimrc.plug file
 13 if filereadable(expand("~/.vimrc.plug"))
 14        source "~/.vimrc.plug"
 15 endif
 16
 17 ":inoremap <Caps> <Esc>
 18 ":inoremap <Caps_Lock> <Esc>
 19 ":inoremap <CapsLock> <Esc>
 20

I've created .vimrc.plug file. It looks like this:

  1 call plug#begin('~/.vim/plugged')
  2
  3 "Fugitive Vim Github Wrapper
  4 Plug 'tpope/vim-fugitive'
  5
  6 call plug#end()

Later I've executed command:

sudo curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Yes. I've checked I have git installed.

I've opened vim and gave command :PlugInstall.

In the output I get E492: Not an editor command: PlugInstall. How to enable those VIM plugins?

I have also got other errors after I've run simple vim command:

michal@ubuntu:~$ vim
Error detected while processing /home/michal/.vimrc[14]../home/michal/.vimrc.plug:
line    2:
E117: Unknown function: plug#begin
line    5:
E492: Not an editor command: Plug 'tpope/vim-fugitive'
line    7:
E117: Unknown function: plug#end
Press ENTER or type command to continue

1 Answers1

1

I tested your config and you have 2 error in your config

  1. for source command you have to pass filepath not string it should be like this example below
if filereadable(expand("~/.vimrc.plug"))
    source ~/.vimrc.plug
endif
  1. for last problem you said you have its because you ran curl command with sudo. so if you using a normal user like "john" you would have permission problem and Error detected while processing /home/michal/.vimrc[14]../home/michal/.vimrc.plug: error for fixing that you have to use curl command without sudo
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Aazerra
  • 26