I have this issue. Let's suppose I have the following directory tree:
diffchar/
├── README.md
├── autoload
│ └── diffchar.vim
├── demo.gif
├── doc
│ ├── diffchar.txt
│ └── tags
├── example1.png
├── example2.png
└── plugin
└── diffchar.vim
If I open diffchar.vim under autoload, the working directory will be set to /path/to/diffchar/autoload. I explicitly specify :cd /path/to/diffchar, but if I open diffchar.txt, the working directory will be set to /path/to/diffchar/doc.
Any idea how to set the working directory to a fix path and that it does not change when I open files under different directories?
You probably have
autochdir(see here) set to on. Check with this vim commandIf the output just says
autochdirand notnoautochdir, then you have it set. Turn it off by doing: