I'm using an autocmd autocmd BufEnter * silent! lcd %:p:h in my init.vim/vimrc to automatically change directory to the opened file. When I open a file from the search results, this autocmd will be triggered (sometimes). I would like to create a pull request to avoid this behavior, so that I can always search from the initial path, e.g. root directory of a project. But even I read the source code I'm not sure which line of the code opens the file from the result. Would you please point it out? Thanks.
I'm using an autocmd
autocmd BufEnter * silent! lcd %:p:h
in my init.vim/vimrc to automatically change directory to the opened file. When I open a file from the search results, this autocmd will be triggered (sometimes). I would like to create a pull request to avoid this behavior, so that I can always search from the initial path, e.g. root directory of a project. But even I read the source code I'm not sure which line of the code opens the file from the result. Would you please point it out? Thanks.