I have NERDTREE installed.
If I open up a whole directory with vim .
I see the following:
If I open up a specific file in the directory with vim file1.txt
, I see the following:
Is there a way to have vim .
not open up the file browser twice? I get that it has no specific file to open, but I'd rather have it just open up only the left hand pane and then nothing on the right, instead of having to always manually close the right side.
Here's the relevant section of my .vimrc
if that helps
" === Plugins
filetype off
call vundle#begin('$HOME/.vim/bundle')
Plugin 'VundleVim/Vundle.vim' " required
Plugin 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
call vundle#end()
filetype plugin indent on
" === Auto Commands
autocmd VimEnter * NERDTree " Start NERDTree on startup
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree")
\ && b:NERDTree.isTabTree()) | q | endif " Close NERDTree explore after last window closes
" === Config
let NERDTreeMinimalUI = 1 " NERDTree Minimal UI
let NERDTreeDirArrows = 1 " NERDTREE Directional Arrows
let NERDTreeShowHidden = 1 " Show hidden files
autocmd
to flush NerdTree out on Vim startup. If you still want to keep that autocmd part, just start Vim without the . (current directory) option. - Wanda Ichsanul Isra