Phase Portrait

Saturday, December 29, 2007

PDFSync Inverse Searches in MacVim

Remember the post on doing inverse searches in Vim on OS X? The idea was to drop gvim-pdfsync into
/usr/local/bin
(or somewhere else in your PATH) and then execute
gvim-pdfsync "%file" %line
to do inverse searches in Vim for OS X just like you can in Windows or in other UNIXes. For example, in Skim, under the PDFSync section of the Sync tab of the Preferences, you can put
Preset: Custom
Command: gvim-pdfsync
Arguments: "%file" %line

For MacVim

I thought it might be nice if I published how to do the same thing in the nascent MacVim, which supports servers just like Vim for Windows. Provided that you've installed the mvim shell script somewhere in your PATH, you can setup Skim with
Preset: Custom
Command: mvim
Arguments: --remote-tab-silent +":%line;foldo!" "%file"

or, if you don't like tabs
Preset: Custom
Command: mvim
Arguments: --remote-silent +":%line;foldo!" "%file"

Retro-Approach

Alternatively, if you really liked the gvim-pdfsync approach and want something similar for mvim, put mvimtab-pdfsync or (if you don't like tabs) mvim-pdfsync in your PATH (e.g., in /usr/local/bin) and then setup Skim for:
Preset: Custom
Command: mvimtab-pdfsync
Arguments: "%file" %line

or (if you used mvim-pdfsync)
Preset: Custom
Command: mvim-pdfsync
Arguments: "%file" %line
I hope that helps.

Labels: , , , , , , , , , , , , , , , , , , , , , , , ,

2 Comments:

  • Hi Ted,

    I am just about to install MacVim on Leopard. Inverse search is supported by Skim, as you wrote. Skim does not have a Leopard version yet, and I was wondering whether one could do the same with Preview, which in Leopard supports notes and Pdf merging. Do you know if this is possible?

    Best.

    Daniele

    By Blogger Daniele Avitabile, at 4:16 AM  

  • Daniele,

    I'm still running Tiger, and so I don't have experience with using the new version of Preview. I was under the impression that Leopard Preview did not support auto-reloading of PDFs, which is a deal breaker for me.

    I would be surprised (SHOCKED, in fact) if Preview supported inverse searching. To support inverse searching, Preview would have to support PDFSync. If it supported PDFSync, I would imagine it would support PDF autoreloading.

    So, my guess is that Preview does not (and probably will not) support inverse searching.

    Sorry that I couldn't give you more help. You might try the Skim mailing list.

    --Ted

    By Blogger Ted, at 8:36 AM  

Post a Comment

Links to this post:

Create a Link

<< Home


 
appalling
appalling
appalling
appalling appalling
appalling
appalling
appalling