Tom,

It's enough to consider one Vim session in which we edit one multi-file
document to make my point. Suppose main.tex includes doc1.tex and doc2.tex.
The only way I know to identify a specific Vim process from the command
line is to refer to it by server name. Thus when I want to work on
main.tex, I start a Vim server using

vim --servername /full/path/to/main.tex main.tex

which ensures unique server names. In that Vim session, I open buffers for
doc1.tex and doc2.tex, edit them, compile and preview in a Skim window.

At a terminal command line, I can ask Vim to take me to line 10 of doc1.tex
by using the command

vim --servername /full/path/to/main.tex --remote-send ":buffer
doc1.tex<CR>:10<CR>"

So that's the command that I'd like Skim to issue when I
command-shift-click somewhere in the PDF. So I placed the above command in
a script that takes a file and a line number as arguments and I have Skim
execute that script with %file and %line as argument values.

Unfortunately, depending on where I command-shift-click in the PDF, %file
evaluates to doc1.tex or doc2.tex. (I realized this by having my script log
to the system console.) The server name is lost. It shouldn't be, because
the server name can be recovered from the PDF file's name!

Thus my request to obtain the PDF file name via, .e.g, %output as has been
suggested by Christiaan.

I hope the situation is clearer. I've no idea how other editors deal with
this but this is the typical situation for me, and it seems natural that a
request from Skim announce what PDF file issued it.

I hope it's not too much trouble to implement this and others find it
useful too (I know colleagues in my team will). I'll of course be happy to
contribute my scripts.


Dominique

On Tue, Dec 9, 2014 at 9:51 AM, Schneider <[email protected]> wrote:

> Dominique:
>
> > Apologies, I do have multiple instances of Vim running (in different
> > terminals) but one Skim instance (and several Skim windows to preview
> > several PDF files).
>
> Perhaps you could explain why you want to do that?  I use vim all the
> time (right now in fact!) to do all my editing.  I see that vim can
> act as a 'server' but the documentation I found gave no indication how
> this would be useful.  I can open multiple terminals and run vim
> separately in each.  Being human I only have one focus at a time that
> I can switch between them.  Memory is cheap, so I don't see the
> advantage of having one vim running.  Why are you doing this?  What is
> the advantage of having vim as a server?  How do you work that you
> need this?
>
> Tom
>
>   Thomas D. Schneider, Ph.D.
>   Senior Investigator
>   National Institutes of Health
>   National Cancer Institute
>   Center for Cancer Research
>   Gene Regulation and Chromosome Biology Laboratory
>   Molecular Information Theory Group
>   Frederick, Maryland  21702-1201
>   http://schneider.ncifcrf.gov (current link)
>   http://alum.mit.edu/www/toms (permanent link)
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Skim-app-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/skim-app-users
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to