|
@@ -41,8 +41,13 @@ if has("autocmd")
|
|
|
|
|
|
|
|
" 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
|
|
|
|
|
|
|
+
|
|
|
|
|
+ " A way to specify startup actions
|
|
|
autocmd VimEnter * call StartUp()
|
|
autocmd VimEnter * call StartUp()
|
|
|
|
|
+
|
|
|
|
|
+ " if the last window is NERDTree, then close Vim
|
|
|
|
|
+ "autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
|
|
|
|
|
+
|
|
|
else
|
|
else
|
|
|
set autoindent on
|
|
set autoindent on
|
|
|
endif
|
|
endif
|
|
@@ -53,9 +58,10 @@ endif
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
function! StartUp()
|
|
function! StartUp()
|
|
|
" Stuff in here will be called by autocmd below
|
|
" Stuff in here will be called by autocmd below
|
|
|
- if 0 == argc()
|
|
|
|
|
|
|
+ " example, start NERDTree if vim called with no arguments
|
|
|
|
|
+ "if 0 == argc()
|
|
|
"NERDTree
|
|
"NERDTree
|
|
|
- end
|
|
|
|
|
|
|
+ "end
|
|
|
endfunction
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
@@ -253,4 +259,13 @@ nnoremap <silent> <expr> $ ScreenMovement("$")
|
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
" let g:NERDTreeQuitOnOpen = 1
|
|
" let g:NERDTreeQuitOnOpen = 1
|
|
|
|
|
+
|
|
|
|
|
+" Having problems showing NERDTree arrows in OS X
|
|
|
|
|
+if has("unix")
|
|
|
|
|
+ let s:uname = system("uname")
|
|
|
|
|
+ if s:uname == "Darwin"
|
|
|
|
|
+ let g:NERDTreeDirArrows=0
|
|
|
|
|
+ endif
|
|
|
|
|
+endif
|
|
|
|
|
+
|
|
|
" let g:SuperTabDefaultCompletionType = 'context'
|
|
" let g:SuperTabDefaultCompletionType = 'context'
|