title: Resizing the vim tabline on NERDTree window resize
body: <p>I am using vim (terminal/console vim NOT gui vim) with NERDTree and NERDTreeTabs. 
  As you may have guessed I like to use vim's tab functionality to keep track of multiple open files.</p>
  
  <p>I never really liked how the tabs would start at the very "beginning" of the tabline (there would be tabs on top of the NERDTree window). I wanted to have the tabs start from the END of the NERDTree window (i.e. the right edge), resembling an IDE. So I defined my own tabline like so:</p>
  
  <pre><code>" Globals
  " NERDTree width
  let g:ntw = 25
  
  set showtabline=2 " Always show tabs
  function! Tabline(width)
      let s = '%#String#'. repeat(' ', a:width).'|'
      for i in range(tabpagenr('$'))
          let tab = i + 1
          let bufnr = tabpagebuflist(tab)[tabpagewinnr(tab) - 1]
          let bufname = bufname(bufnr)
          let s .= '%' . tab . 'T'
          let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#')
          let s .= ' '.(bufname != '' ? fnamemodify(bufname, ':t') : 'New ').' '
          if getbufvar(bufnr, "&amp;mod") " If buf is modified
              let s .= '+ '
          endif
      endfor
      let s .= '%#TabLineFill#'
      return s
  endfunction
  set tabline=%!Tabline(g:ntw)
  let g:NERDTreeWinSize = g:ntw
  </code></pre>
  
  <p>Basically all I am doing is inserting blank spaces into the tabline before any tabs start. The width of the blank spaces would match the width of NERDTree. Now the problem is when I resize the NERDTree window. Obviously, the tab line's extra spacing does not resize itself automatically, resulting in an ugly mismatch. </p>
  
  <p>I was thinking I could find out a way to execute 'set tabline=%!Tabline(g:ntw)" where g:btw is the current width of NERDTree whenever the NERDTree window is resized. But I am unable to find out a way to do this.</p>
  
  <p>As a side note, since I am using NERDTreeTabs plugin, you can assume that the NERDTree window will ALWAYS exist. You can also assume that the NERDTree window will always be on the left.</p>
  
  <p>So then my questions are:</p>
  
  <p>1) Is there a more elegant way of getting this done?</p>
  
  <p>2) If no to 1), how could I achieve what I am trying to do? (example code please)</p>
  
  <p>Thanks in advance!</p>