CHADtree autostart

This autocommand only seems to be possible in vimscript.
This may need further experimentation
This commit is contained in:
Robert Morrison 2022-07-15 06:47:59 +01:00
parent 5eb60c83b1
commit 7374a4d910
Signed by: robert
GPG Key ID: 73E012EB3F4EC696

View File

@ -0,0 +1,9 @@
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