【发布时间】:2011-04-27 07:34:48
【问题描述】:
我在 windows 中使用 gvim。默认情况下 nerdtree 加载 C:\ 驱动器作为默认值。我喜欢将其更改为 E:\ 驱动器。如何实现这一点?
每当我尝试使用 :NERDTree 命令启动 NERDTree 时,都会收到此错误 E492: Not an editor command: NERDTree
【问题讨论】:
我在 windows 中使用 gvim。默认情况下 nerdtree 加载 C:\ 驱动器作为默认值。我喜欢将其更改为 E:\ 驱动器。如何实现这一点?
每当我尝试使用 :NERDTree 命令启动 NERDTree 时,都会收到此错误 E492: Not an editor command: NERDTree
【问题讨论】:
我的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 启动时更改工作目录,这对我来说是明智的。
【讨论】:
%:p:h如何打开活动缓冲区中的文件文件夹?
来自 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)
【讨论】:
在我的vimrc 文件中,我使用这个autocmd vimenter * NERDTree G:\。G:\ 应该设置为您的默认驱动器,但是,它只是 NERDTree 的工作目录。添加cd G:\更改vim 开始工作目录。就像Jeromy Anglim 说的那样。
【讨论】: