On Mar  6 11:54, Milan Vancura wrote:
> > So, the bottom line is, I'm looking for is a way to open a file
> > automatically in r/o mode if I'm going to jump to a tag in that file
> > and the file is opened in another session.
> 
> hi,
> 
> I've thought about the same feature. I think there are three solutions now:
> 
> 1. use one xterm with tabs instead of several xterms
>    (don't like)
> 
> 2. use a communication with vim server to synchronize
>    (seems hard for me)
> 
> 3. write a couple of functions:
> 
>    tagjump - set the variable "jumpingThereBecauseOfTag" and calls tag jump
>    checktag - check the variable "jumpingThereBecauseOfTag" and set readonly 
> if
>               this variable is set and swap file exists
> 
>    then create (and use) a new command :Tj calling tagjump and add an
>    autocommand for BufReadPre event calling checktag
> 
> It's just an idea, I still didn't write these. But I think it should work.

I guess the most easy way to accomplish this is another shortmess option
which is like A, but with an automatic r/o open mode.  If this behaviour
is accompanied with an inverse [readonly] marker (inverse red on color
terminals), that would be sufficient, IMHO.  Actually, if I have a file
already open in another session I never want to open it for editing in
another session.  I'm aware that I'd have to use the -r option to
recover, should that be necessary.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

Reply via email to