Search code examples
vimresizewindowsize

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?


Solution

  • 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