From e31e0db5dc2b3ccfeb3d68fbaaaf1088d57538cf Mon Sep 17 00:00:00 2001 From: tomit4 Date: Fri, 15 Oct 2021 19:20:13 -0700 Subject: [PATCH] updated NerdTree settings --- nvim/init.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 122fbf09..deeca8ed 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -27,9 +27,11 @@ Plug 'HerringtonDarkholme/yats.vim' " TS Syntax call plug#end() inoremap jk nmap :NERDTreeToggle -" open NERDTree automatically + +" Start NERDTree. If a file is specified, move the cursor to its window. autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * NERDTree +autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | 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