aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 11:40:22 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 11:40:22 -0300
commitbbc8784ecd0adae6acb092ba22cbb835ec80193a (patch)
tree61fe9473dcd03e027832d11a2a96e02f47fcb7a8
parent8ed53743ab305c7cdad98cd79f4a1f61a24507d1 (diff)
downloadvim-bbc8784ecd0adae6acb092ba22cbb835ec80193a.tar.gz
vim-bbc8784ecd0adae6acb092ba22cbb835ec80193a.tar.bz2
Fix: rename nerdtree_workarounds plugin to session_workarounds
-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