-" nedtree_workaroungs.vim - NERDTree and session restoration workarounds
+" session_workarounds.vim - Session restoration workarounds
"
" Author: Silvio Rhatto <rhatto@riseup.net>
"
"
" Useful after restoring sessions between screen size changes (such
" as when you share sessions between different computers).
-function FixNERDTreeWidth()
- " Make sure NERDTree is focuses
+function FixWindowWidths()
+ " Make sure NERDTree is focused
execute ":NERDTreeFocus"
" Set a fixed width
wincmd l
endfunction
-" In case you want to invoke FixNERDTreeWidth explicitly
-command! -bang FixNERDTreeWidth :call FixNERDTreeWidth()
+" In case you want to invoke FixWindowWidths explicitly
+command! -bang FixWindowWidths :call FixWindowWidths()
-" Fix NERDTree width on all tabs
-function FixAllNERDTreeWidths()
+" Fix window widths on all tabs
+function FixAllWindowWidths()
" Make sure to run this only once
if exists("did_fixed_nerdtree_widths")
return
" Save the last active window
let l:current_win = win_getid()
- tabdo :call FixNERDTreeWidth()
+ tabdo :call FixWindowWidths()
" Restore the active window
call win_gotoid(l:current_win)
endif
endfunction
+" Restore all window sizes
function RestoreWindowSizes()
call FixWindowHeights()
- call FixAllNERDTreeWidths()
+ call FixAllWindowWidths()
endfunction
" Fix all window sizes
" This seems to fire only once, but even when there's no session to be
" restored.
- "autocmd workaround VimEnter * call FixAllNERDTreeWidths()
+ "autocmd workaround VimEnter * call FixAllWindowWidths()
augroup END