110

I checked the documentation and I couldn't find a way o renaming or copying files and folder using NERDTree. Is it possible?

alexchenco
  • 53,565
  • 76
  • 241
  • 413
  • 1
    type :h NERDTree in vim. you will get almost any help directly from vim. saves time :) – Anand Apr 15 '11 at 13:25

2 Answers2

200

Press m on the node you want to then select (m)ove the current node. Moving is the same as renaming.

NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
> (a)dd a childnode
  (m)ove the curent node
  (d)elete the curent node
  (c)copy the current node
Jeremy Mack
  • 4,987
  • 2
  • 25
  • 22
david
  • 2,151
  • 1
  • 13
  • 6
  • Great answer saved my life! Is there a way to disable the confirm question when delete a file by using 'm + d', It really tedious to confirm, and it need to confirm twice. I just want it no prompt at all. Do you know how to do it? – mko Apr 12 '13 at 01:28
  • 1
    You can disable the confirm prompt by changing confirmed = 0 to confirmed = 1 in nerdtree/nerdtree_plugin/fs_menu.vim – Justin Garrison Sep 18 '14 at 16:51
3

https://github.com/scrooloose/nerdtree/blob/master/doc/NERDTree.txt, the latest version has it:

2.3. The NERD tree menu NERDTreeMenu The NERD tree has a menu that can be programmed via the an API (see |NERDTreeMenuAPI|). The idea is to simulate the "right click" menus that most file explorers have. The script comes with two default menu plugins: exec_menuitem.vim and fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a menu item to execute executable files.

Derek Adair
  • 21,846
  • 31
  • 97
  • 134
Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
  • 1
    I checked it. But how do I make the menu appear? – alexchenco Feb 19 '10 at 11:28
  • If you had installed it properly, you should have a nerdtree_plugin folder in your Vim runtime directory. There should resist exec_menuitem.vim and fs_menu.vim. Now you should only start a graphical Vim instance & NerdTree. – Zsolt Botykai Feb 19 '10 at 11:50
  • 2
    Yeah, I'm using gVim and Nerdtree with "m" I open a windows but renaming isn't there I right click on nodes and renaming is not there either (I do have those 2 files). – alexchenco Feb 19 '10 at 12:05