Comment 1 for bug 293215

Revision history for this message
Nicolas Bonnefon (nickbnf) wrote :

hmm... seems like expected behaviour to me. gvim's 'current directory' is the directory where it is run from, not the directory of the file edited. e.g. if you run "gvim ~/myfolder/myfile.tex" from your home dir, vim's current dir will be your home, not ~/myfolder.
From within gvim, you can use :pwd to display the current directory, and :cd ~/myfolder to change it.

A possible solution to your problem is too add this to your .vimrc:
autocmd BufRead * cd %:p:h
It will automatically change the current directory to the one of the file read when you open a file (it can be a bit irritating because it does it for all files, including helpfiles...) so you can use that if you prefer:
autocmd BufRead *.tex cd %:p:h