2010-05-22 22 views
124

我一直在使用NERDTree。每次我需要创建一个新的目录时,我需要去终端。有没有一种使用NERDTree创建目录的快捷方法。如何使用nerdtree创建一个目录

我读了doc,但找不到任何东西。

+3

这可能在超级用户的归属。 – 2010-05-22 17:10:16

+6

我不会将它移动到超级用户。系统管理员使用Vim,但使用Vim的开发人员整天都在其中;我敢肯定它更适用于开发者。如果有办法链接/克隆它,那将是一个不错的选择。 – 2013-03-24 06:16:26

+0

文档中的相关行很不显眼。它在'NERDTreeMenu'[部分](http://stackoverflow.com/questions/1459750/vim-and-nerd-tree-extension-adding-a-file)中。 – gkb0986 2013-09-24 18:13:05

回答

212

当在NERDTree窗口,按 'M';你应该在底部看到一个菜单。输入'a'以添加子节点。现在输入你想创建的目录,确保在最后加上'/',否则脚本会创建一个文件。

AFAIK NERDTree不能创造这样 '的mkdir -p' 的父目录一样。

+0

当输入a时出现错误处理函数时检测到错误 _15_showMenu .....。罪魁祸首可能是其他一些插件。我稍后会调试它。谢谢。 – 2010-05-23 00:02:52

+0

我使用mkdir但nodetree文件系统结构并不自动刷新 – nkint 2011-04-26 13:57:10

+0

更重要的是,您应该将nerdtree_plugin dir(它位于您的下载包中)放入.vim目录中,或者当您按下'm'时会出现错误。感谢Housetier的回答 – guosheng1987 2012-07-27 03:08:31

1

m将打开下面的菜单,你可以从操作列表中进行选择。

NERDTree Menu. Use j/k/enter and the shortcuts indicated 
========================================================== 
> (a)dd a childnode 
    (m)ove the current node 
    (d)elete the current node 
    (r)eveal in Finder the current node 
    (o)pen the current node with system editor 
    (q)uicklook the current node 
    (c)opy the current node 
Add a childnode 
========================================================== 
Enter the dir/file name to be created. Dirs end with a '/' 
/Library/WebServer/Documents/new-teacher-center/app/Model/ 

a会让你添加一个孩子节点。一个孩子节点可以是一个文件或文件夹,具体取决于是否添加正斜杠(/)。

如果不加斜杠像下面,它会创建一个文件。

Add a childnode 
========================================================== 
Enter the dir/file name to be created. Dirs end with a '/' 
/Library/WebServer/Documents/new-project/app/Model/file 

如果像下面添加正斜杠,它会创建一个文件夹。

Add a childnode 
========================================================== 
Enter the dir/file name to be created. Dirs end with a '/' 
/Library/WebServer/Documents/new-project/app/Model/folder/ 
相关问题