taglist and nerdtree

函数:function! s:Tlist_Window_Exit_Only_Window()中的winbunr(2)改为winbunr(3),即只剩2个窗口时关闭,考虑到2个窗口肯定是同时存在,所以这样还是可行的:

 1 function! s:Tlist_Window_Exit_Only_Window()
 2  
 3     " Before quitting Vim, delete the taglist buffer so that
 4  
 5     " the '0 mark is correctly set to the previous buffer.
 6  
 7     if v:version < 700
 8  
 9     if winbufnr(3) == -1
10  
11         bdelete
12  
13         quit
14  
15     endif
16  
17     else
18  
19     if winbufnr(3) == -1
20  
21         if tabpagenr('$') == 1
22  
23            " Only one tag page is present
24  
25            bdelete
26  
27            quit
28  
29         else
30  
31            " More than one tab page is present. Close only the current
32  
33            " tab page
34  
35            close
36  
37         endif
38  
39     endif
40  
41     endif
42  
43 endfunction

同时在vimrc中需要设置:let Tlist_Exit_OnlyWindow=1

原文地址:https://www.cnblogs.com/wjgaas/p/4207445.html