I realize this is an old question; maybe you still have the issue though.
I had this same problem just now and finally solved it by editing the file compiler.vim in ~/.vim/ftplugin/latex-suite
directly. Tossing in a few echo
s here and there, I noticed that it was taking the branch of the conditional to pick an editor that was for UNIX instead of picking Skim for Mac OS X. I ended up just deleting all the other possibilities for it to launch the viewer, though you could do this more elegantly / better-preserving compatibility by figuring out which parameter is causing it to take the wrong branch of the conditional and then re-coding / debugging accordingly.
For reference, here are my fixed ~/.vim/ftplugin/tex.vim
and the relevant segment of ~/.vim/ftplugin/latex-suite/compiler.vim
(this replaces the function Tex_ForwardSearchLaTeX()
; my function Tex_ViewLaTeX()
worked right off the bat but you may need to modify that function similarly).
" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set sw=2
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
let g:tex_flavor = 'latex'
let g:Tex_MultipleCompileFormat = 'pdf,aux'
let g:Tex_TreatMacViewerAsUNIX = 0
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 --interaction=nonstopmode $*'
let g:Tex_ViewRule_pdf = 'Skim'
" Command-R will write, compile, and forward search--thanks to
" http://reference-man.blogspot.com/2011/09/fully-integrated-latex-in-macvim.html
" preview, switch back to main window
map <D-r> :w<cr><leader>ll<leader>ls
imap <D-r> <ESC><D-r>
let g:Tex_IgnoredWarnings ='
\"Underfull\n".
\"Overfull\n".
\"specifier changed to\n".
\"You have requested\n".
\"Missing number, treated as zero.\n".
\"There were undefined references\n".
\"Citation %.%# undefined\n".
\"Marginpar on page %.%# moved\n".
\"\oval, \circle, or \line size unavailable\n"'
The relevant additions are the ones of the form let g:tex
etc.
Skim is set as below, which assumes as you mentioned that you copied mvim to that location or added it somewhere in $PATH
etc.
Finally the changes to compiler.vim
starting at line 324:
function! Tex_ForwardSearchLaTeX()
if &ft != 'tex'
echo "calling Tex_ForwardSeachLaTeX from a non-tex file"
return
endif
if Tex_GetVarValue('Tex_ViewRule_'.s:target) == ''
return
endif
let viewer = Tex_GetVarValue('Tex_ViewRule_'.s:target)
let s:origdir = fnameescape(getcwd())
let mainfname = Tex_GetMainFileName(':t')
let mainfnameRoot = fnamemodify(Tex_GetMainFileName(), ':t:r')
let mainfnameFull = Tex_GetMainFileName(':p:r')
" cd to the location of the file to avoid problems with directory name
" containing spaces.
call Tex_CD(Tex_GetMainFileName(':p:h'))
if viewer =~ "^ *Skim"
let execString = 'silent! !/Applications/Skim.app/Contents/SharedSupport/displayline '.
\ line('.').' "'.mainfnameFull.'.'.s:target.'" "'.expand("%:p").'"'
elseif viewer =~ "^ *PDFView"
let execString = 'silent! !/Applications/PDFView.app/Contents/MacOS/gotoline.sh '.
\ line('.').' "'.mainfnameFull.'.'.s:target.'" "'.expand("%:p").'"'
elseif viewer =~ "^ *TeXniscope"
let execString = 'silent! !/Applications/TeXniscope.app/Contents/Resources/forward-search.sh '.
\ line('.').' "'.expand("%:p").'" "'.mainfnameFull.'.'.s:target.'"'
endif
call Tex_Debug("Tex_ForwardSearchLaTeX: execString = ".execString, "comp")
execute execString
if !has('gui_running')
redraw!
endif
exe 'cd '.s:origdir
endfunction
Again, obviously, this was just a quick-and-dirty way to edit compiler.vim
and I stopped caring once it worked, so you could make these either more compatible by not removing so many cases of the conditional or more elegant by just skipping the conditional altogether...I'm just wary of jinxing it now that it works ;)
Note: if you need step-by-step instructions for opening and editing these files, please leave a comment...believe me I've been frustrated by how much the related manuals / help files on the interwebs assume you already know how to do with software you're obviously new to, and I'd be glad to walk you through it in as much detail as you need to save you from the same frustration.
Note 2: I believe this is the full extent of changes to the default installation that I have made, but I could have left one out since I've been working on this so much. If this does not work for you, let me know and I'll look into what else I may have incidentally changed.
vim
myself but not on the Mac. Would you mind explaining whatskim
and syncing is all about?macvim
and provide a minial example file. All I could find about configuration is this link.