2010-05-22 18 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/ 
相關問題