aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'vim.dot.link/plugin')
-rw-r--r--vim.dot.link/plugin/session_workarounds.vim (renamed from vim.dot.link/plugin/nerdtree_workarounds.vim)21
1 files changed, 11 insertions, 10 deletions
diff --git a/vim.dot.link/plugin/nerdtree_workarounds.vim b/vim.dot.link/plugin/session_workarounds.vim
index 60e4a1c..be51942 100644
--- a/vim.dot.link/plugin/nerdtree_workarounds.vim
+++ b/vim.dot.link/plugin/session_workarounds.vim
@@ -1,4 +1,4 @@
-" nedtree_workaroungs.vim - NERDTree and session restoration workarounds
+" session_workarounds.vim - Session restoration workarounds
"
" Author: Silvio Rhatto <rhatto@riseup.net>
"
@@ -7,8 +7,8 @@
"
" 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
@@ -18,11 +18,11 @@ function FixNERDTreeWidth()
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
@@ -31,7 +31,7 @@ function FixAllNERDTreeWidths()
" 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)
@@ -75,9 +75,10 @@ function FixWindowHeights()
endif
endfunction
+" Restore all window sizes
function RestoreWindowSizes()
call FixWindowHeights()
- call FixAllNERDTreeWidths()
+ call FixAllWindowWidths()
endfunction
" Fix all window sizes
@@ -88,5 +89,5 @@ augroup workaround
" 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