我在windows中使用gvim。默认的nerdtree默认加载C:\驱动器。我喜欢把它改成E:\ drive.How来实现这个目标?
每当我尝试使用NERDTree命令启动NERDTree时,我收到此错误E492: Not an editor command: NERDTree
答案 0 :(得分:17)
我的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开始对我来说是明智的时候,它只会改变工作目录。
答案 1 :(得分: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)
答案 2 :(得分:0)
在我的vimrc
文件中,我使用此autocmd vimenter * NERDTree G:\
。G:\
应该设置为默认驱动器。