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:
Starting with Vim version 8, you can install plugins without the need for a package manager by using the default package management tool. You can place Vim plugins in the ~/. vim/pack/vendor/start/plugin_name directory. Note that the plugin_name folder name will vary from plugin to plugin.
Nvim's data directory is located in ~/. local/share/nvim/ and contains swap for open files, the ShaDa (Shared Data) file, and the site directory for plugins. Starting from Nvim's version 0.5, it is possible to setup Nvim via Lua, by default ~/. config/nvim/init.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With