Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't open NERDTree

Tags:

nerdtree

In my vimrc,

autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p

but when I start writting a file, it tips error:

  Error detected while processing VimEnter Auto commands for "*":
  E492: Not an editor command: NERDTree

Anyone can help me ?

like image 914
znlyj Avatar asked May 16 '26 03:05

znlyj


1 Answers

I tried to install NERDTree using vim-plug, so when I started vim and run :PlugInstall, I can use :NERDTree command but after going out it was no available, reason is I didn't download plugin cause I used github, so according to documentation you have to use it on demand and wrap it up your instruction:

call plug#begin('~/.vim/plugged') " Specify folder
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
call plug#end() " Initializes plugins

So your plugins are available now, and you can use your instructions:

autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
like image 98
G. I. Joe Avatar answered May 19 '26 02:05

G. I. Joe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!