diff --git a/.vimrc b/.vimrc index f0d50b4..39c0e0b 100644 --- a/.vimrc +++ b/.vimrc @@ -6,6 +6,8 @@ set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin('~/.vim/plugged') " Let Vundle manage Vundle; muss immer der erste Eintrag sein Plugin 'VundleVim/Vundle.vim' +" project drawer +Plugin 'preservim/nerdtree' " ansible integration Plugin 'pearofducks/ansible-vim' " omnicompletion während dem tippen @@ -187,6 +189,8 @@ nmap Y y$ " https://www.reddit.com/r/vim/comments/s1he17/is_there_a_plugin_that_makes_searching_and nnoremap sr :%s///gc vnoremap sr y:%s/"//gc +" Toggle NERDTree +nnoremap :NERDTreeToggle " ### Abbreviations iabbrev ncicht nicht @@ -203,3 +207,11 @@ nnoremap z :set nonumber! norelativenumber! " entferne trailing whitespaces beim speichern autocmd BufWritePre * :%s/\s\+$//e + +" Start NERDTree when Vim is started without file arguments. +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif +" Exit Vim if NERDTree is the only window remaining in the only tab. +autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif +" NERDTree - show hidden files +let NERDTreeShowHidden=1