zizhongyan / vim-stata

Vim Plugin for Running Selected Do-File in Stata
https://github.com/zizhongyan/vim-stata
9 stars 7 forks source link

Stata changing directory to location of temporary do-file #5

Open raheem03 opened 3 years ago

raheem03 commented 3 years ago

I successfully installed the plugin using Vundle and was able to follow the instructions to get everything to work. The only complication is that when I send a line of code to Stata, Stata automatically changes the working directory to the location of the temporary do-file. Any ideas why this might be the case?

I'm running this on MacOS/Catalina/Stata 16.1.

Thanks!

raheem03 commented 3 years ago

After some exploration: My guess is that opening a file directly from the command line changes the directory to the location of the file. It's possible this behavior is new to recent versions of Stata.

FWIW, one alternative that seems to work is to use the AppleScript commands.