Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NERDTree Load Particular Directory Automatically

Tags:

vim

nerdtree

I'm using gvim in windows.By default nerdtree loads C:\ drive as default.I like to change it to E:\ drive.How to achieve this?

Whenever I try to start NERDTree using :NERDTree command, I get this error E492: Not an editor command: NERDTree

like image 386
blakcaps Avatar asked Apr 27 '11 07:04

blakcaps


1 Answers

I have the following code in my vimrc file

cd ~/documents
map <F2> :NERDTreeToggle<CR>
" open Nerd Tree in folder of file in active buffer
map <Leader>nt :NERDTree %:p:h<CR>

The cd command is not NerdTree specific. It just changes the working directory when Vim starts to something which for me is sensible.

like image 187
Jeromy Anglim Avatar answered Sep 21 '22 11:09

Jeromy Anglim