Browse Source

fix NERDTree automatic opening

cinaeco 13 years ago
parent
commit
62d934cc49
1 changed files with 3 additions and 2 deletions
  1. 3 2
      vim/vimrc

+ 3 - 2
vim/vimrc

@@ -10,13 +10,12 @@ call pathogen#infect()
 "" Start Up
 "" Start Up
 """""""""""""""""""""""""""""""""""""""""""""""""""
 """""""""""""""""""""""""""""""""""""""""""""""""""
 function! StartUp()
 function! StartUp()
+    " Stuff in here will be called by autocmd below
     if 0 == argc()
     if 0 == argc()
         NERDTree
         NERDTree
     end
     end
 endfunction
 endfunction
 
 
-autocmd VimEnter * call StartUp()
-
 
 
 """"""""
 """"""""
 "" General Behaviours
 "" General Behaviours
@@ -44,6 +43,8 @@ if has("autocmd")
     \ endif
     \ endif
     " Source the vimrc file after saving it
     " Source the vimrc file after saving it
     autocmd bufwritepost .vimrc source $MYVIMRC
     autocmd bufwritepost .vimrc source $MYVIMRC
+    " so far, this startup just opens NERDTree when there are no arguments
+    autocmd VimEnter * call StartUp()
 else
 else
     set autoindent on
     set autoindent on
 endif
 endif