Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing pdfs with vim latex-suite: !start Preview shell returned 127

Tags:

vim

I have Mac OS X Lion, vim 7.3, and latex-suite. With a minimal .tex file I can compile a pdf from within vim using \ll. However I can't view the pdf with \lv. The FAQ suggests that I check whether or not I can open my pdf viewer from inside vim with

!start Preview

However when I do this I get the message

shell returned 127.

Can anyone help me with this?

like image 814
Alex Avatar asked Sep 29 '12 06:09

Alex


1 Answers

You can use !open -a Preview to open Preview.

Here is my settings to make <leader>lv work for me:

let g:tex_flavor='latex'
let g:Tex_TreatMacViewerAsUNIX = 1
let g:Tex_ExecuteUNIXViewerInForeground = 1
let g:Tex_ViewRule_ps = 'open -a Skim'
let g:Tex_ViewRule_pdf = 'open -a /Applications/Skim.app'
let g:Tex_ViewRule_dvi = 'open -a /Applications/texniscope.app'

Note that I am using Skim instead of Preview as PDF viewer here. You can simply put:

let g:Tex_ViewRule_ps = 'open -a Preview'
let g:Tex_ViewRule_pdf = 'open -a Preview'

to view the resulting postscript or PDF file with Preview.

like image 92
K Z Avatar answered Sep 21 '22 12:09

K Z