10

我在 Windows 中使用 gvim。默认情况下,nerdtree 加载 C:\ 驱动器作为默认值。我喜欢将其更改为 E:\ 驱动器。如何实现这一点?

每当我尝试使用 :NERDTree 命令启动 NERDTree 时,都会收到此错误E492: Not an editor command: NERDTree

4

3 回答 3

22

我的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 启动时更改工作目录,这对我来说是明智的。

于 2011-04-27T08:50:53.557 回答
5

从 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)

于 2014-09-26T14:51:30.147 回答
1

在我的vimrc文件中,我使用了这个。应该设置你的默认驱动器,但是,它只是 NERDTree 的工作目录autocmd vimenter * NERDTree G:\G:\添加cd G:\更改 vim 开始工作目录。就像 Jeromy Anglim 说的那样。

于 2019-07-22T11:07:08.727 回答