diff --git a/.vimrc b/.vimrc index af02384..8eff410 100644 --- a/.vimrc +++ b/.vimrc @@ -63,12 +63,12 @@ let NERDTreeShowLineNumbers = 0 " Hide line numbers let NERDTreeMinimalMenu = 1 " Use the minimal menu (m) let NERDTreeWinSize = 31 " Set panel width to 31 columns nmap :NERDTreeToggle " ruft NERDtree mit F2 auf -" Start NERDTree. If a file is specified, move the cursor to its window. +" Start NERDTree when Vim is started without file arguments. autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif +autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif let g:nerdtree_sync_cursorline = 1 " highlight the file in tree " open the existing NERDTree on each new tab. -autocmd BufWinEnter * silent NERDTreeMirror +"autocmd BufWinEnter * silent NERDTreeMirror " " exit Vim if NERDTree is the only window left. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |