11

I am just getting started with Vim and setting up the environment with some of the plugins recommended by http://vimawesome.com/. I downloaded and placed plug.vim in C:\Program Files\Vim\vim74\autoload and in C:\Program Files\Vim\vimfiles\plugin I put the git master branch nerdtree-master and renamed it to nerdtree. In the _vimrc file, which is otherwise working, I put

Plug 'scroloose/nerdtree

and

Plug 'nerdtree

Neither of these commands worked. And I receive this error:

Error detected while processing C:\Program Files\Vim\_vimrc:

line    7:

E492: Not an editor command: Plug 'nerdtree'

Error detected while processing
C:\Program Files\Vim\vim74\plugin\nerdtree\lib\nerdtree\path.vim:
halfer
  • 19,824
  • 17
  • 99
  • 186
noumenal
  • 1,077
  • 2
  • 16
  • 36
  • 1
    Your plugin manager (what provides the `Plug` command) isn't properly installed. What steps / instructions did you follow? Is there something (above that) in your `.vimrc` that invokes `autoload/plug.vim`? Also, better install your user configuration into `$HOME/_vimrc` / `$HOME/vimfiles`, not into the system location. – Ingo Karkat Apr 23 '15 at 13:25

1 Answers1

3

I finally figured out that I had forgot to wrap the line Plug 'nerdtree' with

call plug#begin('~/.vim/plugged')
Plug 'nerdtree'
call plug#end()

Although .vim is a Linux path, Vim or Vim-Plug was able to recognize the path. I then received an error that Git must be installed. I already had Git installed, so I simply added C:\Program Files\Git\bin to the system environment variable %PATH%. After restarting Vim I typed

:PlugInstall

in the Vim editor.

The vim-plug plugin manager got to work and printed:

- Finishing ... Done!
x nerdtree:
    Cloning into 'C:\Users\labbedz7\.vim\plugged\nerdtree'...
    remote: Invalid username or password.
    fatal: Authentication failed for 'https://git::@github.com/vim-scripts/nerdtree.git/'

Now, Git did not "authenticate" because the string in Plug 'String' refers to the GitHub URL path: http://github.com/String. By changing to the actual path: scrooloose/nerdtree I was able to run :PlugInstall again.

call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
call plug#end()

This resulted in:

Updated. Elapsed time: 5.706874 sec.
[=]

- Finishing ... Done!
- nerdtree: Checking connectivity... done

I then added these lines to _vimrc:

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

Nerdtree is now running! It starts in Windows\System32 and is a bit slow to load, but it is running.

noumenal
  • 1,077
  • 2
  • 16
  • 36