Remote Mouse Support

29 views
Skip to first unread message

Paul

unread,
Jan 7, 2010, 12:21:55 PM1/7/10
to vim...@googlegroups.com
Hi, I'm wondering if this is even possible:

I want to ssh to a remote server, open vim, split a file, and drag the split separator around with the mouse. More importantly, I want to use the "* register, so I can select text with the keyboard and put it into my local X buffer (to paste with shift-insert). None of this currently works for me.

X11 forwarding is working - xclock on the remote server displays on my local screen.

The terminal window title does change when I edit different files.

I have compiled GUI support into the remote vim -

Normal version with GTK GUI. Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv -cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
-emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path
+float +folding -footer +fork() -gettext -hangul_input -iconv +insert_expand
+jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm
-mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm -multi_byte
+multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
+signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
+toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
+xsmp_interact +xterm_clipboard -xterm_save

Is there something I am missing?

--

.

Stroller

unread,
Jan 7, 2010, 3:03:06 PM1/7/10
to vim...@googlegroups.com

On 7 Jan 2010, at 17:21, Paul wrote:
> ...

$ euses g | grep mouse
gpm - Adds support for sys-libs/gpm (Console-based mouse driver)
kde-base/kcontrol:logitech-mouse - Build the Control Center module to
configure logitech mice
$ eix ^gpm -o ^vim$
[I] app-editors/vim
Available versions: 7.0.235 ~7.0.243 7.1.123 ~7.1.330 7.2.182
~7.2.264 ~7.2.303 {acl bash-completion cscope debug gpm minimal nls
perl python ruby vim-pager vim-with-x}
Installed versions: 7.2.182(07:39:55 14/09/09)(acl nls perl
python -bash-completion -cscope -gpm -minimal -ruby -vim-pager -vim-
with-x)
Homepage: http://www.vim.org/
Description: Vim, an improved vi-style text editor

* sys-libs/gpm
Available versions: 1.20.1-r6 1.20.5 ~1.20.6 {selinux}
Homepage: http://linux.schottelius.org/gpm/
Description: Console-based mouse driver

Found 2 matches.
$

This would appear to be "mouse_gpm" on your distro. No idea if it will
work across X11, though.

Stroller.

Jason Axelson

unread,
Jan 8, 2010, 1:59:15 AM1/8/10
to vim_use
On Jan 7, 7:21 am, Paul <google01...@rainslide.net> wrote:
> Hi, I'm wondering if this is even possible:
>
> I want to ssh to a remote server, open vim, split a file, and drag the split separator around with the mouse. More importantly, I want to use the "* register, so I can select text with the keyboard and put it into my local X buffer (to paste with shift-insert). None of this currently works for me.

I just wanted to report that I do have this working, although often
times it gets in the way for me so I may turn it off in the future.

Jason

Charles Campbell

unread,
Jan 8, 2010, 9:39:17 AM1/8/10
to vim...@googlegroups.com

Just thought I'd mention an alternative -- use netrw and edit the file
locally. vim scp://hostname/path/file will let you edit the file
locally, using the mouse/selection locally, and when you :w the file
will be saved back to the remote machine.

Regards,
Chip Campbell

Paul

unread,
Jan 8, 2010, 10:43:43 AM1/8/10
to vim...@googlegroups.com
On Thu, Jan 07, 2010 at 08:03:06PM +0000, Stroller wrote:
>This would appear to be "mouse_gpm" on your distro. No idea if it will
>work across X11, though.

Aha. I installed gpm-devel (gpm was already installed) and I can now make use of "*, but I still can't move the separator around with the mouse.

I can't use netrw because I have to run the file on the remote machine and do other things that require the remote environment set.

--

.

Matt Wozniski

unread,
Jan 8, 2010, 6:02:08 PM1/8/10
to vim...@googlegroups.com
On Thu, Jan 7, 2010 at 12:21 PM, Paul wrote:
> Hi, I'm wondering if this is even possible:
>
> I want to ssh to a remote server, open vim, split a file, and drag the split
> separator around with the mouse. More importantly, I want to use the "*
> register, so I can select text with the keyboard and put it into my local X
> buffer (to paste with shift-insert). None of this currently works for me.
>
> X11 forwarding is working - xclock on the remote server displays on my local
> screen.
>
> The terminal window title does change when I edit different files.
>
> I have compiled GUI support into the remote vim -

You seem to be having two separate issues. As far as getting the
mouse working, the only requirements are that a) your terminal
emulator supports sending mouse clicks to applications, b) you have
+mouse compiled into your vim (you do), and c) that the 'mouse' and
'ttymouse' options are set up to allow it. Try :set mouse=a if you
haven't already, that might be all that's needed. Otherwise, we'll
need more info.

Your other issue is talking to the X server. If x forwarding is
working properly, this should just work. If you launch terminal vim
on the remote, and then use the :gui command, does the Vim window "pop
out" into a new GVim window? That would be a good way to make sure
that vim can talk to the x server. Another quick way would be to copy
some text to the clipboard on the local machine, and then check with
:reg if it shows up in the * or + registers on the remote machine.
After telling us the results of those tests, we'll probably be in a
much better position to help.

~Matt

Paul

unread,
Jan 11, 2010, 8:04:33 AM1/11/10
to vim...@googlegroups.com
On Fri, Jan 08, 2010 at 06:02:08PM -0500, Matt Wozniski wrote:
>You seem to be having two separate issues. As far as getting the
>mouse working, the only requirements are that a) your terminal
>emulator supports sending mouse clicks to applications, b) you have
>+mouse compiled into your vim (you do), and c) that the 'mouse' and
>'ttymouse' options are set up to allow it. Try :set mouse=a if you
>haven't already, that might be all that's needed. Otherwise, we'll
>need more info.

ttymouse=TERM and mouse=a. What more info would you like? :)

>Your other issue is talking to the X server. If x forwarding is

This is working now, since I installed gpm-mouse.

--

.

Matt Wozniski

unread,
Jan 11, 2010, 12:09:59 PM1/11/10
to vim...@googlegroups.com
On Mon, Jan 11, 2010 at 8:04 AM, Paul wrote:
> On Fri, Jan 08, 2010 at 06:02:08PM -0500, Matt Wozniski wrote:
>>
>> You seem to be having two separate issues.  As far as getting the
>> mouse working, the only requirements are that a) your terminal
>> emulator supports sending mouse clicks to applications, b) you have
>> +mouse compiled into your vim (you do), and c) that the 'mouse' and
>> 'ttymouse' options are set up to allow it.  Try :set mouse=a if you
>> haven't already, that might be all that's needed.  Otherwise, we'll
>> need more info.
>
> ttymouse=TERM and mouse=a. What more info would you like? :)

ttymouse shouldn't be set to TERM, it should be set to either "xterm"
or "xterm2". What terminal emulator are you running? Do things work
properly with a local vim instance running in that terminal?

>> Your other issue is talking to the X server.  If x forwarding is
>
> This is working now, since I installed gpm-mouse.

Strange - gpm should only be required if you're ssh'ing from a linux
virtual console (ie, /dev/tty1 by doing ctrl-alt-f1); it shouldn't
affect things using an X11 terminal...

~Matt

pansz

unread,
Jan 12, 2010, 12:24:42 AM1/12/10
to vim...@googlegroups.com
Paul 写道:

> Hi, I'm wondering if this is even possible:
>
> I want to ssh to a remote server, open vim, split a file, and drag the
> split separator around with the mouse. More importantly, I want to use
> the "* register, so I can select text with the keyboard and put it into
> my local X buffer (to paste with shift-insert). None of this currently
> works for me.
>
> X11 forwarding is working - xclock on the remote server displays on my
> local screen.


If X11 forwarding is working, why not just use gvim instead of vim?

You can start gvim from the remote server and have full mouse support.


For console vim, I can't even use mouse to drag the split separator
locally. So this is not a problem with remote server, it is about the
configuration of your console vim.


Paul

unread,
Jan 12, 2010, 5:39:47 AM1/12/10
to vim...@googlegroups.com
On Mon, Jan 11, 2010 at 12:09:59PM -0500, Matt Wozniski wrote:
>> ttymouse=TERM and mouse=a. What more info would you like? :)
>
>ttymouse shouldn't be set to TERM, it should be set to either "xterm"
>or "xterm2". What terminal emulator are you running? Do things work
>properly with a local vim instance running in that terminal?

Sorry, that was a typo. ttymouse is indeed 'xterm'. I'm using mlterm, and things do work properly locally.

>Strange - gpm should only be required if you're ssh'ing from a linux
>virtual console (ie, /dev/tty1 by doing ctrl-alt-f1); it shouldn't
>affect things using an X11 terminal...

Yeah, well, I dunno. 'Stroller', in a previous reply, suggested that it was an issue with "mouse_gpm" in the distro, so I just installed it and it worked.

--

.

Reply all
Reply to author
Forward
0 new messages