一、安装NERDTree插件php
二、使用先下载,官网:http://www.vim.org/scripts/script.php?script_id=1658linux
解压缩以后,把 plugin/NERD_tree.vim 和doc/NERD_tree.txt分别拷贝到~/.vim/plugin 和 ~/.vim/doc 目录。vim
一、在linux命令行界面,输入vimide
二、输入 :NERDTree ,回车this
三、进入当前目录的树形界面,经过小键盘上下键,能移动选中的目录或文件spa
四、目录前面有+号,摁Enter会展开目录,文件前面是-号,摁Enter会在右侧窗口展示该文件的内容,并光标的焦点focus右侧。插件
五、ctr+w+h 光标focus左侧树形目录,ctrl+w+l 光标focus右侧文件显示窗口。屡次摁 ctrl+w,光标自动在左右侧窗口切换命令行
六、光标focus左侧树形窗口,摁? 弹出NERDTree的帮助,再次摁?关闭帮助显示code
七、输入:q回车,关闭光标所在窗口orm
Q. How can I open a NERDTree automatically when vim starts up?
A. Stick this in your vimrc: autocmd vimenter * NERDTree
Q. How can I open a NERDTree automatically when vim starts up if no files were specified?
A. Stick this in your vimrc
autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
Q. How can I map a specific key or shortcut to open NERDTree?
A. Stick this in your vimrc to open NERDTree with Ctrl+n
(you can set whatever key you want): map <C-n> :NERDTreeToggle<CR>
Q. How can I close vim if the only window left open is a NERDTree?
A. Stick this in your vimrc:
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif