nvimconfig/after/plugin/CHADtree.vim
Robert Morrison 7374a4d910
CHADtree autostart
This autocommand only seems to be possible in vimscript.
This may need further experimentation
2022-07-15 06:47:59 +01:00

10 lines
422 B
VimL

augroup CHADTreeAutoStart
autocmd!
" Auto start NERD tree when opening a directory
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | execute 'CHADopen' argv()[0] | wincmd p | enew | wincmd p | endif
" Auto start NERD tree if no files are specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | exe 'CHADopen' | endif
augroup END