aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/plugin/session_workarounds.vim
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 20:31:25 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 20:31:25 -0300
commitb6a77530871c56ffc5d05b510f7eac8774fbc7ec (patch)
tree97ecc3f1ad94d5da14d172d7d7600161336a5f66 /vim.dot.link/plugin/session_workarounds.vim
parent803eff47d7b76dfbd83b845be97d434a17e7d522 (diff)
downloadvim-b6a77530871c56ffc5d05b510f7eac8774fbc7ec.tar.gz
vim-b6a77530871c56ffc5d05b510f7eac8774fbc7ec.tar.bz2
Feat: folding markers
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
+" }}}