diff --git a/sub/vim/vimrc b/sub/vim/vimrc index 4d7eef3..5372ee2 100644 --- a/sub/vim/vimrc +++ b/sub/vim/vimrc @@ -56,11 +56,14 @@ let g:netrw_keepdir = 0 " Mirror the NERDTree before showing it. This makes it the same on all tabs. -nnoremap n :NERDTreeMirror:NERDTreeToggle +nnoremap nn :NERDTreeMirror:NERDTreeToggle + +" Toggle focus +nnoremap nf :wincmd p " 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 +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. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif