I wanted to use the script that you sent in your final answer .
Unfortunately, it did not work with my setup (MacVim with vim-latexsuite, Skim as a viewer and XeTeX). I also use direct search (i.e. I use a function that pressing \ ls in Vim will jump to the corresponding point in the PDF document in the open viewer).
Also, my document is not called thesis.tex (big surprise, its not a thesis). Ive, therefore, did another tuning job that Id would like to share. Warning, my bash skills are terrible.
#!/bin/bash set -x ulimit -t 10
Compiles a temporary file and copies it back to any name (instead of using its script); script usage:
./scriptname project
Where project is the TeX file name without the file extension.
Ive also changed the rubber-info :
autocmd FileType tex exe "set makeprg=rubber-info\\ _" . expand("%:t:r") . ".log"
And I needed to fix my latexmk in order to use XeTeX, since the name of the executable was hard-coded.
Unfortunately, this still destroys the output PDF when Ive saved my document before completing the instructions, since latexmk always seems to create a PDF, even if it latexmk - and its return code is always 0, which sucks.
(To clarify this, let's say that Ive just typed emph{ into my document and saved it. The background script will quickly compile the document and not work. But it will still produce a (mostly empty) output file).
In addition, direct search no longer works properly; it basically goes to the wrong point on the document. I suspect this has something to do with my copying the document before compiling.
So, this is still a completely unsatisfactory solution, although I have not even turned on continuous saving when entering MacVim yet.