views:

334

answers:

4

To my understanding, you can add files directly from MacVim with the NERDTree plugin. I navigate to NERDtree and hit 'm' to bring up the NERDTree filesystem menu as described in this post: http://stackoverflow.com/questions/1459750/vim-and-nerd-tree-extension-adding-a-file

The problem is, I get this output after invoking 'm':

NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
Error detected while processing function <SNR>14_showMenu..30..31:
line    4:
E716: Key not present in Dictionary: menuItems)-1)
E116: Invalid arguments for function len(self.menuItems)-1)
E116: Invalid arguments for function range(0, len(self.menuItems)-1)
E15: Invalid expression: range(0, len(self.menuItems)-1)
Press ENTER or type command to continue
A: 

This is a bug in the NERDTree plugin, you should send an email to the author, Marty Grenfell

too much php
+1  A: 

I use NERD_tree with MacVim all of the time and I have no problems adding new files. Check what version of NERD_tree you are using. If you look in the file:

~/.vim/plugins/NERD_tree.vim

You should see this line near the top if you are using the latest version:

let s:NERD_tree_version = '4.1.0'

Also make sure that fs_menu.vim is present (this plugin is required for the file system commands)

~/.vim/nerdtree_plugin/fs_menu.vim
GWW
A: 

If you clone the git repository, make sure you run "rake install" from inside the repo...I didn't do this, and chose to just copy things around myself, and I missed the fs_menu.vim file that GWW mentioned above and that's what was giving me the error mentioned above. I just cloned the repository anew and ran "rake install" and everything works perfectly now.

davertron
A: 

GWW's solution works. I got it work. thanks

toledot