How to install Vim plugins on Windows

I'm just getting started with Vim and setting up my environment with some plugins recommended by . I downloaded and put the plug.vim file in C:\Program Files\Vim\vim74\autoload

and in. C:\Program Files\Vim\vimfiles\plugin

I put the git master branch in nerdtree-master

and renamed it to nerdtree

. In a file _vimrc

that otherwise works, I put

Plug 'scroloose/nerdtree



Plug 'nerdtree


None of these commands worked. And I am getting 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:



source to share

1 answer

Finally figured out that I forgot to wrap the line Plug 'nerdtree'


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


Although .vim

this is the path to Linux, Vim or Vim-Plug were able to recognize the path. Then I got an error that Git should be installed. I already have Git installed, so I just added C:\Program Files\Git\bin

to the system environment variable %PATH%

. After restarting Vim, I typed



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 ''


Now, Git is not authenticated because the string in Plug 'String'

references to the path of URL-addresses GitHub:

. Going to the actual path: scrooloose/nerdtree

I managed to start again :PlugInstall


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


The result was:

Updated. Elapsed time: 5.706874 sec.

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


Then I 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 working! It runs on Windows \ System32 and loads a little slower, but it works.



All Articles