3

This is a very basic question but I can't figure out how to configure MacVim (v7.3) properly to work with ConTeXt (MkIV) and Skim on Snow Leopard. Is there somebody who would kindly explain the steps that need to be taken for the setup and how to use MacVim comfortably (regarding compilation and PDF viewing and not navigation, of course)?

I am currently using TeXShop which works fine but I'd like learn about the (Mac)Vim editor too.

kaktus
  • 81

2 Answers2

1

You could use the ex-mode command to run a program, :!, and tell it to run context with the current file as input (%). That is, in full:

:!context %

This will run ConTeXt on the file, and show the compilation information in a split Vim buffer.

To open the produced PDF file in Skim, you can issue:

:!open -a Skim %:r.pdf

On consequent compilations, Skim will detect that the file has changed, and ask you if you would like to always automatically reload the rewritten document. You can then make changes to the tex-document, save with :w, and re-compile with :, pressing the up-arrow to list command history. Now Skim should automatically show the recompiled version without asking anything.

MacVim has an option to compile the document with a keyboard shortcut (⌘B), but this seems a bit complicated to set up to use with (any-)TeX.

For general Vi(m) usage, there is a handy cheat sheet here.

morbusg
  • 25,490
  • 4
  • 81
  • 162
1

I always run latexmk -pdf -pvc -pdflatex=lualatex in a separate terminal and edit with Vim and view the result in Skim. latexmk will recompile whenever you save in vim. The benefit being that latexmk takes care of multiple runs and all that stuff. As for running context instead of lualatex just switch to running: latexmk -pdf -pvc -pdflatex=context example.tex. And as mentioned in other answer, skim will pick up on file changes and update.

jonalv
  • 11,466