Open NERDTree and Tlist one above the other in Vim

I am looking for a way (automatically) to open NERDTree and Tlist on the left side directly above each other so that each plug-in occupies half the height of the screen. I have already found this question in which Muhammad's answer is what I am looking for. However, I wonder if there is a more direct way to do this.

+3
source share
1 answer

This requires a solution that requires a little editing in the taglist.vim script. I have not developed all the possible consequences, but it seems to still work well. Change the function "Tlist_Window_Create" to "taglist.vim" to include the elseif statement shown here:

 ... " Create a new window. If user prefers a horizontal window, then open " a horizontally split window. Otherwise open a vertically split " window if g:Tlist_Use_Horiz_Window " Open a horizontally split window let win_dir = 'botright' " Horizontal window height let win_size = g:Tlist_WinHeight elseif g:Tlist_Use_Split_Window " Open the window in a horizontal split of current window let win_dir = 'abo' let win_size = g:Tlist_WinWidth else ... 

I inserted this start on line 1290 in the last TagList (v4.5). Then add the following to your .vimrc

 let Tlist_Use_Split_Window = 1 com TT NERDTree | TlistToggle 

Now the command :TT opens the TagList over NERDTree in one vertical window. How it is not completely divided halfway, but it is close. If you prefer a tree on top, change abo above to split .

+6
source

All Articles