How can I adopt side panel plugins (TagBar, TagList, NerdTree, etc) width to current screen aspect ratio?
Using Vim with many different computers makes me a bit trouble to write one portable config for all of them. The problem is aspect ratio of screen. It varies from 4:3 - 1024x768 to 16:9 - 1920x1080. What I want is stable 80 columns for "main" window and rest for panels.
+-----------+-----------------------+-----------+
| NERD Tree | Main content window | Tag Bar |
| | 80 columns width | |
| | | |
| | | |
| | | |
| | | |
+-----------+-----------------------+-----------+
Now I have a local variable in .vimrc:
let s:side_panel_width = 24
let g:NERDTreeWinSize = s:side_panel_width
let g:tagbar_width = s:side_panel_width
But it's ugly solution, since I must have many special configs with different values. Another option I found is winwidth(0) Vim function. So I think it is possible to write function, that calculates side panel size for current configuration.
Have somebody already solved this problem? Or can you suggest better options? By the way, how should I call this function - autocmd on VimEnter - or something else?