NERDTree安装

NERDTree安装及简单的使用方法

NERDTree安装

wget http://www.vim.org/scripts/download_script.php?src_id=17123 -O nerdtree.zip 
unzip nerdtree.zip

mkdir -p ~/.vim/{plugin,doc}

cp plugin/NERD_tree.vim ~/.vim/plugin/
cp doc/NERD_tree.txt ~/.vim/doc/

依次执行上面的这几条命令即可
然后在/etc/vim/vimrc中添加下面几行

" F3 NERDTree 切换

 map <F3> :NERDTreeToggle<CR>

 imap <F3> <ESC>:NERDTreeToggle<CR>

快捷方式

    " NERD tree (4.2.0) quickhelp                                       "============================                                                
" File node mappings      
" double-click,                                                                                    
" o: open in prev window                                                                                                          
" go: preview                                                               
" t: open in new tab           
" T: open in new tab silently                                                  
    " middle-click,                                                                
" i: open split                                                                 
" gi: preview split                                                                
" s: open vsplit                                                                  
" gs: preview vsplit                                                                    
    "                                                                          
" ----------------------------                                                  
" Directory node mappings                                                  
" double-click,                                                                
" o: open & close node                                                                                                                          
" O: recursively open node                                                                                                                        
" x: close parent of node      
" X: close all child nodes of                                                                                                                   
"    current node recursively                                                                                                                       
" middle-click,                
    " e: explore selected dir                                                                                                                         
"                                                                                                                                           
" 

    " ----------------------------                                                                                                                    
" Tree navigation mappings~                                                                                                                    
" P: go to root                                                                                                                                   
" p: go to parent              
" K: go to first child         
" J: go to last child          
" <C-j>: go to next sibling      
" <C-k>: go to prev sibling   
" Filesystem mappings~         
" C: change tree root to the     
"    selected dir               
" u: move tree root up a dir   
" U: move tree root up a dir   
"    but leave old root open   
" r: refresh cursor dir        
" R: refresh current root         
" m: Show menu                    
" cd:change the CWD to the       
"    selected dir                 
"                            

" Bookmark table mappings~                                                                                                                       
" double-click,                
" o: open bookmark                                                            
" t: open in new tab                                                                                                                                
" T: open in new tab silently                                                                                                            
" D: delete bookmark           

" D: delete bookmark             
"                                 
" ----------------------------    
" Tree navigation mappings~     
" P: go to root                   
" p: go to parent                
" K: go to first child           
" J: go to last child           
" <C-j>: go to next sibling      
" <C-k>: go to prev sibling        
"                               
" ----------------------------  
" Filesystem mappings~          
" C: change tree root to the    
"    selected dir              
" u: move tree root up a dir   
" U: move tree root up a dir         
"    but leave old root open   
    " r: refresh cursordir                                                                                                                              
" R: refresh current root      
" m: Show menu                   
" cd:change the CWD to the     
"    selected dir                
"                                 
" ---------------------------- 
" Tree filtering mappings~        
" I: hidden files (off)         
" f: file filters (on)            
" F: files(on)                                                                                                                                     
" B: bookmarks (off)           
" Other mappings~                
" q: Close the NERDTree window 
" A: Zoom (maximize-minimize)   
    "    the NERDTreewindow                                                                                                                     
" ?: toggle help                                                                                                                                   
"                              
" ----------------------------                                                                                                                    
" Bookmark commands~           
    " :Bookmark<name>                                                                                                                              
" :BookmarkToRoot <name>                                                                                                                          
" :RevealBookmark <name>                                                                                                                             
" :OpenBookmark <name>                                                                                                                               
" :ClearBookmarks [<names>]                                                                                                                 
" :ClearAllBookmarks 

ctrl + w + h    光标 focus 左侧树形目录
ctrl + w + l    光标 focus 右侧文件显示窗口
ctrl + w + w    光标自动在左右侧窗口切换
ctrl + w + r    移动当前窗口的布局位置
o       在已有窗口中打开文件、目录或书签,并跳到该窗口
go      在已有窗口 中打开文件、目录或书签,但不跳到该窗口
t       在新 Tab 中打开选中文件/书签,并跳到新 Tab
T       在新 Tab 中打开选中文件/书签,但不跳到新 Tab
i       split 一个新窗口打开选中文件,并跳到该窗口
gi      split 一个新窗口打开选中文件,但不跳到该窗口
s       vsplit 一个新窗口打开选中文件,并跳到该窗口
gs      vsplit 一个新 窗口打开选中文件,但不跳到该窗口
!       执行当前文件
O       递归打开选中 结点下的所有目录
x       合拢选中结点的父目录
X       递归 合拢选中结点下的所有目录
e       Edit the current dif
双击    相当于 NERDTree-o
中键    对文件相当于 NERDTree-i,对目录相当于 NERDTree-e
D       删除当前书签
P       跳到根结点
p       跳到父结点
K       跳到当前目录下同级的第一个结点
J       跳到当前目录下同级的最后一个结点
k       跳到当前目录下同级的前一个结点
j       跳到当前目录下同级的后一个结点
C       将选中目录或选中文件的父目录设为根结点
u       将当前根结点的父目录设为根目录,并变成合拢原根结点
U       将当前根结点的父目录设为根目录,但保持展开原根结点
r       递归刷新选中目录
R       递归刷新根结点
m       显示文件系统菜单
cd      将 CWD 设为选中目录
I       切换是否显示隐藏文件
f       切换是否使用文件过滤器
F       切换是否显示文件
B       切换是否显示书签
q       关闭 NerdTree 窗口
?       切换是否显示 Quick Help

切换标签页

:tabnew [++opt选项] [+cmd] 文件      建立对指定文件新的tab
:tabc   关闭当前的 tab
:tabo   关闭所有其他的 tab
:tabs   查看所有打开的 tab
:tabp   前一个 tab
:tabn   后一个 tab

此处来张截图
这里写图片描述

我的建议是先安装NERDTree然后在配置vimrc文件 ,因为之前的有一段时间怎么都安装不上,就是因为vimrc中的某些配置与其产生了一些问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值