Browse Source

Perform startup-time initialization immediately.

Buffer-tracking auto-commands need not be delayed until the `VimEnter`
event.
Michael Henry 10 months ago
parent
commit
df4382488b
1 changed files with 8 additions and 14 deletions
  1. 8 14
      plugin/bufexplorer.vim

+ 8 - 14
plugin/bufexplorer.vim

@@ -136,20 +136,14 @@ let s:didSplit = 0
 let s:types = ["fullname", "homename", "path", "relativename", "relativepath", "shortname"]
 
 " Setup the autocommands that handle stuff. {{{2
-autocmd VimEnter * call s:Setup()
-
-" Setup {{{2
-function! s:Setup()
-    " Add the other autocmds.
-    augroup BufExplorer
-        autocmd!
-        autocmd WinEnter        * call s:DoWinEnter()
-        autocmd BufEnter        * call s:DoBufEnter()
-        autocmd BufDelete       * call s:DoBufDelete()
-        autocmd BufWinEnter \[BufExplorer\] call s:Initialize()
-        autocmd BufWinLeave \[BufExplorer\] call s:Cleanup()
-    augroup END
-endfunction
+augroup BufExplorer
+    autocmd!
+    autocmd WinEnter        * call s:DoWinEnter()
+    autocmd BufEnter        * call s:DoBufEnter()
+    autocmd BufDelete       * call s:DoBufDelete()
+    autocmd BufWinEnter \[BufExplorer\] call s:Initialize()
+    autocmd BufWinLeave \[BufExplorer\] call s:Cleanup()
+augroup END
 
 " AssignTabId {{{2
 " Assign a `tabId` to the given tab.