Skip to content

Commit

Permalink
VIM: configure nerdtree to autoopen when no arg set, and autoclose wh…
Browse files Browse the repository at this point in the history
…en no open files
  • Loading branch information
atomantic committed Mar 20, 2017
1 parent 7eb4215 commit b07cfc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homedir/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ endfunction
" map <left> <ESC>:NERDTreeToggle<RETURN> " moves left fa split
" map <F2> <ESC>ggVG:call SuperRetab()<left>
" map <F12> ggVGg? " apply rot13 for people snooping over shoulder, good fun
map ,n <plug>NERDTreeTabsToggle<CR>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Useful abbrevs
Expand Down Expand Up @@ -272,6 +271,13 @@ vnoremap <silent> <leader>es :EsformatterVisual<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let NERDTreeShowHidden=1
let NERDTreeIgnore=['\.DS_Store$']
" auto open if no file sent as arg
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Toggle NERDtree with C-n
map ,n <plug>NERDTreeTabsToggle<CR>
" Autoclose if only NERDtree is left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Syntastic
Expand Down

0 comments on commit b07cfc6

Please sign in to comment.