0

When I open a new file, [n]vim changes directory into home, regardless of the directory i am in.

I didn't wrote code for that behavior, so that must be a plugin. How can I figure out the origin of this? So that I can disable or tweak the plugin. There must be a way to find out what is causing vim to cd to home.

1 Answers1

0

It might be caused by an autocommand. You can list them all with :autocmd or do some filtering by looking at likely candidates such as

:autocmd BufNew
:autocmd BufNewFile
:autocmd BufEnter
Friedrich
  • 1,846
  • 1
  • 11
  • 21
  • thanks. I found out that it was due to a autocmd which executed "mkview and loadview" on BufWinEnter/BufWinLeave. for some reason this caused to cd into home –  Feb 17 '23 at 22:39