2011-04-27 55 views
7

我在windows中使用gvim。默认情况下,nerdtree将C:\驱动器加载为默认值。我想将其更改为E:\ drive.How如何实现此目的?NERDTree自动加载特定目录

每当我尝试使用启动NERDTree:NERDTree命令,我得到这个错误E492: Not an editor command: NERDTree

回答

14

我在vimrc文件下面的代码

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

cd命令不是NerdTree具体。当Vim开始时,它只是改变了工作目录,对我来说是明智的。

3

来自NERDTree帮助文件: :NERDTree [<start-directory> | <bookmark>] *:NERDTree* Opens a fresh NERD tree. The root of the tree depends on the argument given. There are 3 cases: If no argument is given, the current directory will be used. If a directory is given, that will be used. If a bookmark name is given, the corresponding directory will be used. For example: > :NERDTree /home/marty/vim7/src :NERDTree foo (foo is the name of a bookmark)