I have a MacBook and I am writing a latex file in vim and I render to created pdf in Skim. I have setup Skim to check for file changes. Every time I save my latex file, I get an error from Skim that says: "Unable to load file". The file is still loaded correctly, so I am not sure why I am getting this error. Is there something that I need to do in order not to get this error?
Asked
Active
Viewed 167 times
1 Answers
2
This may be related to the way that Vim is writing the buffer. With the default value of 'backupcopy'
, Vim renames the original file, and then writes a new one with the updated contents. Other applications that observe the original file for changes might get confused about that, resulting in that error you see.
Try :setlocal backupcopy=yes
. If that gets rid of the error, you can define this globally (with :set
) in your ~/.vimrc
, or just for Latex files via the corresponding :help ftplugin-overrule
.

Ingo Karkat
- 167,457
- 16
- 250
- 324
-
Hi Ingo, thanks for your assistance, but it did not help. I have since determined that Skim loads a changed pdf immediately after saving the tex file (before compilation using latexmk). Not sure what is causing this as there is nothing in the init.vim which indicates that latexmk is run automatically. I suspect this is the problem. I must also add that other files work fine with no issue, it is just the main.tex file which is the problem. I am now stumped, not sure how to solve this or what to attribute this behaviour to. – P. Khoza Dec 19 '19 at 09:22