aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link
diff options
context:
space:
mode:
Diffstat (limited to 'vim.dot.link')
-rw-r--r--vim.dot.link/filetype.vim2
-rw-r--r--vim.dot.link/plugin/nerdtree_workarounds.vim16
2 files changed, 13 insertions, 5 deletions
diff --git a/vim.dot.link/filetype.vim b/vim.dot.link/filetype.vim
index 6679641..9204987 100644
--- a/vim.dot.link/filetype.vim
+++ b/vim.dot.link/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
if exists("did_load_filetypes")
- finish
+ finish
endif
" Markdown
diff --git a/vim.dot.link/plugin/nerdtree_workarounds.vim b/vim.dot.link/plugin/nerdtree_workarounds.vim
index d0d682e..a78ed0c 100644
--- a/vim.dot.link/plugin/nerdtree_workarounds.vim
+++ b/vim.dot.link/plugin/nerdtree_workarounds.vim
@@ -32,6 +32,11 @@ command! -bang FixNERDTreeWidth :call FixNERDTreeWidth()
" Fix NERDTree width on all tabs
function FixAllNERDTreeWidths()
+ " Make sure to run this only once
+ if exists("did_fixed_nerdtree_widths")
+ return
+ endif
+
" Save the last active window
let l:current_win = win_getid()
@@ -42,14 +47,17 @@ function FixAllNERDTreeWidths()
" An additional, last move to the left pane
wincmd l
+
+ let dir_fixed_nerdtree_widths=1
endfunction
" Fix all NERDTree widths afert session load
augroup workaround
autocmd!
- " This tends to fire for every buffers
- "autocmd workaround SessionLoadPost * call FixAllNERDTreeWidths()
+ " This tends to fire for every buffer
+ autocmd workaround SessionLoadPost * call FixAllNERDTreeWidths()
- " This seems to fire only once
- autocmd workaround VimEnter * call FixAllNERDTreeWidths()
+ " This seems to fire only once, but even when there's no session to be
+ " restored.
+ "autocmd workaround VimEnter * call FixAllNERDTreeWidths()
augroup END