I think we are missing some easy integration with gnome desktop. Here is
how I got to think so:

I was working with some files on a remote folder using nautilus and
noticed I could open remote text files with gedit transparently; but
that did not work with gvim.
I knew vim can handle editing over ssh, and I would really value
clicking on a remote file and have it opened in gvim instead of gedit.

To cut a long story short I ended up in making this small script
under /usr/local/bin

#!/bin/bash

if [[ $# = 0 || $# = 1 && $1 = "-f" ]]; then
  /usr/bin/gvim $1
else
  /usr/bin/gvim --remote-tab `echo $@ | sed 's/-f//' | sed 's/ssh:
\/\/\(\w\+\)@\(\w\+\)\//scp:\/\/[EMAIL PROTECTED]/\//gi'`
fi

And now gvim behaves just like gedit!
I can open files from nautilus in the existing gvim session and open
files from a ssh folder. I like this behaviour and I think that very
little work is necessary to implement such features in the official
gvim, at least in the one with gnome support.

Basically what we need to get this quikly is:

1: have netrw handle links like ssh:[EMAIL PROTECTED]/folder/file just like it
handles scp:[EMAIL PROTECTED]//folder/file. May require similar changes for
other protocols as well.
2: allow --remote-tab with no argument to open a blank gvim session
instead of failing
3: change the exec line of the gvim.desktop from "gvim -f %U" to "gvim
-f -p --remote-tab %F"

Even better: we could add some internal options like ":set remotetabs"
and ":set openintabs" so that this behavior can be set on a per user
basis. This would be elegant and could work with "gvim -f %F" exec
command in the .dekstop file.

I'd like to know your opinions about this.

PS: it also seems that --remote-tab does play well with gnome
startup-notification when a session is already opened, but this is just
a cosmetic bug.



Reply via email to