vim: Nerdtree Integration

This commit is contained in:
Michael Grote 2022-07-31 09:46:13 +02:00
parent 8251f2771d
commit af9c11a0e3

12
.vimrc
View file

@ -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 <Leader>sr :%s/<C-r><C-w>//gc<Left><Left><Left>
vnoremap <Leader>sr y:%s/<C-R>"//gc<Left><Left><Left>
" Toggle NERDTree
nnoremap <F2> :NERDTreeToggle<CR>
" ### Abbreviations
iabbrev ncicht nicht
@ -203,3 +207,11 @@ nnoremap <Leader>z :set nonumber! norelativenumber!<CR>
" 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