aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/plugin/session_workarounds.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim.dot.link/plugin/session_workarounds.vim')
-rw-r--r--vim.dot.link/plugin/session_workarounds.vim15
1 files changed, 10 insertions, 5 deletions
diff --git a/vim.dot.link/plugin/session_workarounds.vim b/vim.dot.link/plugin/session_workarounds.vim
index 3b43b5b..31dec9f 100644
--- a/vim.dot.link/plugin/session_workarounds.vim
+++ b/vim.dot.link/plugin/session_workarounds.vim
@@ -3,7 +3,7 @@
" Author: Silvio Rhatto <rhatto@riseup.net>
"
-" Fix NERDTree width
+" Fix NERDTree width {{{
"
" Useful after restoring sessions between screen size changes (such
" as when you share sessions between different computers).
@@ -20,8 +20,9 @@ endfunction
" In case you want to invoke FixWindowWidths explicitly
command! -bang FixWindowWidths :call FixWindowWidths()
+" }}}
-" Fix window widths on all tabs
+" Fix window widths on all tabs {{{
function FixAllWindowWidths()
" Make sure to run this only once
if exists("did_fixed_window_widths")
@@ -41,8 +42,9 @@ function FixAllWindowWidths()
let did_fixed_window_widths=1
endfunction
+" }}}
-" Ensure the window has maximized height
+" Ensure the window has maximized height {{{
"
" This helps restoring the window size after reopening sessions after
" switching monitors (like from laptop screen to external HDMI monitor).
@@ -78,14 +80,16 @@ function FixWindowHeights()
" execute ':set lines=' . winheight(0) - 3
endif
endfunction
+" }}}
-" Restore all window sizes
+" Restore all window sizes {{{
function RestoreWindowSizes()
call FixWindowHeights()
call FixAllWindowWidths()
endfunction
+" }}}
-" Fix all window sizes
+" Fix all window sizes {{{
augroup workaround
autocmd!
" This tends to fire for every buffer
@@ -95,3 +99,4 @@ augroup workaround
" restored.
"autocmd workaround VimEnter * call FixAllWindowWidths()
augroup END
+" }}}