This commit is contained in:
TheK4n 2022-08-06 15:08:31 +03:00
parent 407143e842
commit 578729dd88

View File

@ -56,11 +56,14 @@ let g:netrw_keepdir = 0
" Mirror the NERDTree before showing it. This makes it the same on all tabs. " Mirror the NERDTree before showing it. This makes it the same on all tabs.
nnoremap <silent> <leader>n :NERDTreeMirror<CR>:NERDTreeToggle<CR> nnoremap <silent> <leader>nn :NERDTreeMirror<CR>:NERDTreeToggle<CR>
" Toggle focus
nnoremap <silent> <leader>nf :wincmd p<CR>
" Start NERDTree when Vim is started without file arguments. " Start NERDTree when Vim is started without file arguments.
autocmd StdinReadPre * let s:std_in=1 autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | wincmd p | endif
" Exit Vim if NERDTree is the only window remaining in the only tab. " 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 autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif