I would add the following line to `init.vim` ``` let s:hasfolder=1 let g:foldertogo = '.' function s:parse_arguments() let i = 1 while i < len(v:argv) if v:argv[i][0] == '-' let i = i + 2 else let path = v:argv[i] if path[len(path)-1] == '\' || path[len(path)-1] == '/' let path = path[:-2] endif if finddir(escape(fnamemodify(path, ':t'), ' '), escape(fnamemodify(path, ':h'), ' ')) != '' let s:hasfolder = 1 let g:foldertogo = v:argv[i] break else let s:hasfolder = 0 endif let i = i + 1 endif endwhile endfunction call s:parse_arguments() if s:hasfolder augroup FolderToGo autocmd! autocmd VimEnter * :execute "cd " . g:foldertogo augroup END endif ``` Here are my observation about the behavior of Vim and Neovim concerning that aspect: - Vim 9.1 on Windows change to directory - gVim 9.1 on Windows change to directory - Vim 9.1 on Linux *don-t change* to directory - gVim 9.1 on Linux *don't change* to directory - Vim 8.2 on Windows change to directory - gVim 8.2 on Windows change to directory - Neovim 0.95 on Windows *don't change* to directory - Neovim 0.95 on Linux *don't change* to directory Summary: - It seems it change to folder only for Vim under Windows