how to enable mouse in vim of cygwin

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

how to enable mouse in vim of cygwin

suniuin
hello,

I know that both vim and gvim can jump from one window to another by
clicking the mouse, also many other easy facilities.
Here I am using cygwin under XP and my gvim works fine with mouse, but
the vim doesn't in both cmd.ext environment and xterm cases.

Please help me.

Best Regards,
sun
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

A.J.Mechelynck
sun wrote:

> hello,
>
> I know that both vim and gvim can jump from one window to another by
> clicking the mouse, also many other easy facilities.
> Here I am using cygwin under XP and my gvim works fine with mouse, but
> the vim doesn't in both cmd.ext environment and xterm cases.
>
> Please help me.
>
> Best Regards,
> sun
>

If it's a Cygwin build, you may need to make sure that Cygwin can get mouse
actions (which may need running the gpm daemon, or something) and that Vim has
the corresponding feature (such as +mouse_gpm or +mouse_xterm) compiled-in.


Best regards,
Tony.
--
The debate rages on: Is PL/I Bachtrian or Dromedary?
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
hi, but how do I know whether my Cygwin support the mouse or how to
make it support.

Best Regards,
sun
>
> If it's a Cygwin build, you may need to make sure that Cygwin can get mouse
> actions (which may need running the gpm daemon, or something) and that Vim has
> the corresponding feature (such as +mouse_gpm or +mouse_xterm) compiled-in.
>
>
> Best regards,
> Tony.
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

Gary Johnson
On 2007-04-23, sun <[hidden email]> wrote:

> > If it's a Cygwin build, you may need to make sure that Cygwin can get mouse
> > actions (which may need running the gpm daemon, or something) and that Vim
> > has
> > the corresponding feature (such as +mouse_gpm or +mouse_xterm) compiled-in.
> >
> >
> > Best regards,
> > Tony.

>  hi, but how do I know whether my Cygwin support the mouse or how to
>  make it support.

You can find out either by executing

    :version

within vim or by executing

    vim --version

at the bash prompt.  My Cygwin vim :version report includes the
following:

    +mouse
    -mouseshape
    +mouse_dec
    -mouse_gpm
    -mouse_jsbterm
    +mouse_netterm
    +mouse_xterm

and the mouse doesn't work for me, either, in neither rxvt locally
nor in xterm over an ssh connection.  Unfortunately, I don't have
the time to investigate it further at the moment.

The :version command reports features that are enabled or disabled
at compile time.  The only way to enable or disable any of these
features is to recompile vim.

To find out more about any of those features, execute ":help"
followed by the + version of the feature name, e.g.,

    :help +mouse

HTH,
Gary

--
Gary Johnson                 | Agilent Technologies
[hidden email]     | Mobile Broadband Division
                             | Spokane, Washington, USA
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
> and the mouse doesn't work for me, either, in neither rxvt locally
> nor in xterm over an ssh connection.  Unfortunately, I don't have
> the time to investigate it further at the moment.
>
> HTH,
> Gary

the mouse state of my vim --version is:

+mouse +mouseshape -mouse_dec -mouse_gpm
-mouse_jsbterm -mouse_netterm +mouse_xterm

and I have same problem with you, I think the vim was compiled with
mouse supporting but it doesn't work on cygwin,  could anyone help me?

sun
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

iler.ml
In reply to this post by suniuin
On 4/18/07, sun <[hidden email]> wrote:
> hello,
>
> I know that both vim and gvim can jump from one window to another by
> clicking the mouse, also many other easy facilities.
> Here I am using cygwin under XP and my gvim works fine with mouse, but
> the vim doesn't in both cmd.ext environment and xterm cases.

You need to set ':set mouse=all'. Then your vim-in-xterm will
reacti to the mouse.

The cmd box is different case, I beleive that mouse events are
not passed to vim in cmd box.

Yakov
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
> You need to set ':set mouse=all'. Then your vim-in-xterm will
> reacti to the mouse.

yes, that works.

> The cmd box is different case, I beleive that mouse events are
> not passed to vim in cmd box.
>
> Yakov

en..., I was used to opening cygwin by cmd.exe, and also vim in it. It
is not necessary to open X server then start a xterm, but the problem
is that vim in cmd can not react to mouse.
That should be great if the mouse were usable in cmd mode.

sun
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

Albie Janse van Rensburg
sun wrote:

>> You need to set ':set mouse=all'. Then your vim-in-xterm will
>> reacti to the mouse.
>
> yes, that works.
>
>> The cmd box is different case, I beleive that mouse events are
>> not passed to vim in cmd box.
>>
>> Yakov
>
> en..., I was used to opening cygwin by cmd.exe, and also vim in it. It
> is not necessary to open X server then start a xterm, but the problem
> is that vim in cmd can not react to mouse.
> That should be great if the mouse were usable in cmd mode.
>
> sun
>
>
I'm using cygwin and rxvt. It works quite well, since you don't need to
start an X server for the application - it just runs.

Put the following in your cygwin launcher (cygwin_rxvt.bat for me):

 > @echo off
 > C:
 > chdir C:\cygwin\bin
 > set SHELL=/bin/bash
 > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey

and in your .bashrc:

 > export TERM="rxvt-cygwin-native"

your mouse should work fine with rxvt (mine does!)

Cheers

--

Albie Janse van Rensburg ~ http://morph.telspace.co.za

Please don't send me any MS Word or Powerpoint attachments
unless it's absolutely neccessary - send simply text.
http://www.gnu.org/philosophy/no-word-attachments.html

Reality is just a convenient measure of complexity.
                -- Alvy Ray Smith

Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
> I'm using cygwin and rxvt. It works quite well, since you don't need to
> start an X server for the application - it just runs.
>
> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
>
>  > @echo off
>  > C:
>  > chdir C:\cygwin\bin
>  > set SHELL=/bin/bash
>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
>
> and in your .bashrc:
>
>  > export TERM="rxvt-cygwin-native"
>
> your mouse should work fine with rxvt (mine does!)
>
> Cheers

yes, I like this way. But when I open the vim, it is extremely slow,
it needs about half minute to open a file, what is the problem?

sun
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
In reply to this post by Albie Janse van Rensburg
> I'm using cygwin and rxvt. It works quite well, since you don't need to
> start an X server for the application - it just runs.
>
> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
>
>  > @echo off
>  > C:
>  > chdir C:\cygwin\bin
>  > set SHELL=/bin/bash
>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
>
> and in your .bashrc:
>
>  > export TERM="rxvt-cygwin-native"
>
> your mouse should work fine with rxvt (mine does!)
>
> Cheers

Now I can use mouse to jump from one split window to another under
rxvx, but how to resize one? I can't do it by mouse in my case, can
you?

sun
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

A.J.Mechelynck
sun wrote:

>> I'm using cygwin and rxvt. It works quite well, since you don't need to
>> start an X server for the application - it just runs.
>>
>> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
>>
>>  > @echo off
>>  > C:
>>  > chdir C:\cygwin\bin
>>  > set SHELL=/bin/bash
>>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
>>
>> and in your .bashrc:
>>
>>  > export TERM="rxvt-cygwin-native"
>>
>> your mouse should work fine with rxvt (mine does!)
>>
>> Cheers
>
> Now I can use mouse to jump from one split window to another under
> rxvx, but how to resize one? I can't do it by mouse in my case, can
> you?
>
> sun
>

You should be able to drag the status lines and vertical dividers to resize
the split windows.

Best regards,
Tony;
--
hundred-and-one symptoms of being an internet addict:
212. Your Internet group window has more icons than your Accessories window.
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

Albie Janse van Rensburg
A.J.Mechelynck wrote:

> sun wrote:
>>> I'm using cygwin and rxvt. It works quite well, since you don't need to
>>> start an X server for the application - it just runs.
>>>
>>> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
>>>
>>>  > @echo off
>>>  > C:
>>>  > chdir C:\cygwin\bin
>>>  > set SHELL=/bin/bash
>>>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
>>>
>>> and in your .bashrc:
>>>
>>>  > export TERM="rxvt-cygwin-native"
>>>
>>> your mouse should work fine with rxvt (mine does!)
>>>
>>> Cheers
>>
>> Now I can use mouse to jump from one split window to another under
>> rxvx, but how to resize one? I can't do it by mouse in my case, can
>> you?
>>
>> sun
>>
>
> You should be able to drag the status lines and vertical dividers to
> resize the split windows.
>
> Best regards,
> Tony;
I can confirm that this seems to not work, using the cygwin Vim version
when run in rxvt.  Tab-switching and window selection does work, however.

:version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 10 2006 10:07:11)
Included patches: 1-122
Compiled by corinna@cathi
Huge version without 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 +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
 +file_in_path +find_in_path +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_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 -xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2
Linking: gcc   -L/usr/local/lib -o vim.exe       -lncurses  -liconv -lintl

settings:
:set
--- Options ---
  background=dark     laststatus=2        mouse=a            
scroll=14           ttyfast             ttymouse=xterm      window=59
  statusline=%<%1*=== %5*%f%1*%( === %4*%h%1*%)%( === %4*%m%1*%)%( ===
%4*%r%1*%) ===%==== %2*%b(0x%B)%1* === %3*%l,%c%V%1* === %5*%P%1* ===%0*

  viminfo=!,'20,<50,s10,h


--

Albie Janse van Rensburg ~ http://morph.telspace.co.za

Please don't send me any MS Word or Powerpoint attachments
unless it's absolutely neccessary - send simply text.
http://www.gnu.org/philosophy/no-word-attachments.html

For fast-acting relief, try slowing down.

Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

Gary Johnson
On 2007-05-04, Albie Janse van Rensburg <[hidden email]> wrote:

>  A.J.Mechelynck wrote:
> > sun wrote:
> >>> I'm using cygwin and rxvt. It works quite well, since you don't need to
> >>> start an X server for the application - it just runs.
> >>>
> >>> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
> >>>
> >>>  > @echo off
> >>>  > C:
> >>>  > chdir C:\cygwin\bin
> >>>  > set SHELL=/bin/bash
> >>>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
> >>>
> >>> and in your .bashrc:
> >>>
> >>>  > export TERM="rxvt-cygwin-native"
> >>>
> >>> your mouse should work fine with rxvt (mine does!)
> >>>
> >>> Cheers
> >>
> >> Now I can use mouse to jump from one split window to another under
> >> rxvx, but how to resize one? I can't do it by mouse in my case, can
> >> you?

> > You should be able to drag the status lines and vertical dividers to resize
> > the split windows.

>  I can confirm that this seems to not work, using the cygwin Vim version when
>  run in rxvt.  Tab-switching and window selection does work, however.

First, thank you to Yakov for the "set mouse=a" suggestion.  I've
had that in my Unix .vimrc for so long and didn't need in it in my
Windows _vimrc for gvim that I forgot about needing it when the
mouse didn't work in my Cygwin vim.

That fixed the problem completely for the case where I run an xterm
on a Linux machine, ssh to my Windows machine, and run Cygwin vim on
that Windows machine through that xterm.  However, as Sun and Albie
have reported, it doesn't fix the whole problem when running Cywin
vim in a non-X rxvt running on the Windows machine:  I can split a
window and select the active window with the mouse, but I still
cannot drag the status line.

Regards,
Gary

--
Gary Johnson                 | Agilent Technologies
[hidden email]     | Mobile Broadband Division
                             | Spokane, Washington, USA
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

iler.ml
In reply to this post by suniuin
On 5/4/07, sun <[hidden email]> wrote:

> > I'm using cygwin and rxvt. It works quite well, since you don't need to
> > start an X server for the application - it just runs.
> >
> > Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
> >
> >  > @echo off
> >  > C:
> >  > chdir C:\cygwin\bin
> >  > set SHELL=/bin/bash
> >  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
> >
> > and in your .bashrc:
> >
> >  > export TERM="rxvt-cygwin-native"
> >
> > your mouse should work fine with rxvt (mine does!)
> >
> > Cheers
>
> yes, I like this way. But when I open the vim, it is extremely slow,
> it needs about half minute to open a file, what is the problem?

try 'vim -X'

Yakov
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

A.J.Mechelynck
In reply to this post by Gary Johnson
Gary Johnson wrote:

> On 2007-05-04, Albie Janse van Rensburg <[hidden email]> wrote:
>>  A.J.Mechelynck wrote:
>>> sun wrote:
>>>>> I'm using cygwin and rxvt. It works quite well, since you don't need to
>>>>> start an X server for the application - it just runs.
>>>>>
>>>>> Put the following in your cygwin launcher (cygwin_rxvt.bat for me):
>>>>>
>>>>>  > @echo off
>>>>>  > C:
>>>>>  > chdir C:\cygwin\bin
>>>>>  > set SHELL=/bin/bash
>>>>>  > rxvt -ls -sr -sl 1500 -fn "Lucida ConsoleP-12" -bg black -fg grey
>>>>>
>>>>> and in your .bashrc:
>>>>>
>>>>>  > export TERM="rxvt-cygwin-native"
>>>>>
>>>>> your mouse should work fine with rxvt (mine does!)
>>>>>
>>>>> Cheers
>>>> Now I can use mouse to jump from one split window to another under
>>>> rxvx, but how to resize one? I can't do it by mouse in my case, can
>>>> you?
>
>>> You should be able to drag the status lines and vertical dividers to resize
>>> the split windows.
>
>>  I can confirm that this seems to not work, using the cygwin Vim version when
>>  run in rxvt.  Tab-switching and window selection does work, however.
>
> First, thank you to Yakov for the "set mouse=a" suggestion.  I've
> had that in my Unix .vimrc for so long and didn't need in it in my
> Windows _vimrc for gvim that I forgot about needing it when the
> mouse didn't work in my Cygwin vim.
>
> That fixed the problem completely for the case where I run an xterm
> on a Linux machine, ssh to my Windows machine, and run Cygwin vim on
> that Windows machine through that xterm.  However, as Sun and Albie
> have reported, it doesn't fix the whole problem when running Cywin
> vim in a non-X rxvt running on the Windows machine:  I can split a
> window and select the active window with the mouse, but I still
> cannot drag the status line.
>
> Regards,
> Gary
>

Just noticed something on this Linux machine:

- In gvim I can drag the status line with no problem;
- In the linux console (/dev/tty, pure text non-X), with +mouse_gpm and the
gpm daemon running, I can too;
- In konsole (with +mouse_xterm and $TERM=xterm) I can't. I can select an area
by dragging the mouse, but the highlight only appears when I release the
button (in gvim and /dev/tty it appears as soon as the mouse moves with Button
1 depressed).

It's hard to tell what happens: I might think that Vim-in-xterm only gets
mouse events when a button is released: apparently, it never feels mouse
moves, and doesn't see a buttondown as long as the buttonup hasn't happened...
  Clicking (mousedown+mouseup) on a statusline selects the corresponding
window, but there's no way I can drag that statusbar -- or the vertical
separation between vertically split windows.

On the contrary, both gvim and vim-in-non-X-terminal obviously get the
buttondowns, drags and buttonups as soon as they happen.


Best regards,
Tony.
--
"I can't complain, but sometimes I still do."
                -- Joe Walsh
Reply | Threaded
Open this post in threaded view
|

Re: how to enable mouse in vim of cygwin

suniuin
In reply to this post by iler.ml
> > yes, I like this way. But when I open the vim, it is extremely slow,
> > it needs about half minute to open a file, what is the problem?
>
> try 'vim -X'
>
> Yakov

yes, it works, thanks!
sun