disabling change dir to undefined var in line 121

startDir is not set in line 121 :
autocmd VimEnter * execute "cd" fnameescape(g:startDir)

it should be disabled or startDir could be calculated according to opened file (or maybe preceded by a line like bellow to avoid error messages)

let startDir = getcwd()
autocmd VimEnter * execute "cd" fnameescape(g:startDir)