4

I am trying to add NERDTree to my RHEL machine by appending following lines in .vimrc after placing NERD_tree.vim in plugin folder.

autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p

The problem is that I am able to run it using these commands in Mac but RHEL throws this error:

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

Can somebody help me resolve this error?

Vaibhav Agarwal
  • 1,124
  • 4
  • 16
  • 25

2 Answers2

6

When :NERDTree also doesn't work, that means that the plugin isn't properly installed.

To troubleshoot, check the output of :scriptnames; it must list .../plugin/NERD_tree.vim (in the location where you've put it), and verify the value of 'runtimepath', especially if you use a plugin manager (like Pathogen, Vundle, etc.)

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
0

Possibly the package manager pathogen.vim isn't installed yet.

Run:

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

then add the following lines to .vimrc:

execute pathogen#infect()
syntax on
filetype plugin indent on
Hugues Fontenelle
  • 5,275
  • 2
  • 29
  • 44