Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM: how to get current window size, so that I can set NEEDTree to 1/3 window size?

I wish when I bring out NEEDTree or TagBar, the window size is always 1/3 of my original vim window size, no matter how big my vim window is, it's calculated automatically.

How to do this?

like image 889
Troskyvs Avatar asked Dec 11 '22 12:12

Troskyvs


1 Answers

vim has built-in function winwidth({nr}) to get window width. If you pass a zero as win number, it will return your the width of current window.

To change the window size of NerdTree, you have to set the variable: NERDTreeWinSize

like image 112
Kent Avatar answered Dec 20 '22 21:12

Kent