Mouse + curses (+ vim), was Re: Apt-Get or Aptitude
[This message has also been posted to linux.debian.user.]
In article <9k8H9-7BFfirstname.lastname@example.org>, Nate Duehr wrote:
> On Oct 29, 2007, at 9:49 PM, Daniel Burrows wrote:
>> occasionally notice people writing that they just discovered
>> curses interface after using it for ages, so I know that this isn't
>> universally known.
> I think the niftiest feature (and one that still has me scratching my
> head as to how you accomplished it) is the MOUSE control in curses
> over SSH from a WINDOWS box?! That's amazing.
> (In case you're not sure what I mean... get on a Windows box, fire up
> PuTTY (I'm sure PuTTY is also "helping" in this scenario somehow) and
I first saw that in the vi clone "elvis." Shortly after I suggested
it to its author. But maybe he was already working on it.
vi's "visual" edit commands go [<number>]<operator><cursor motion>.
He just added "mouse click" to the long list of cursor motion
gestures already available. So delete from here to there becomes
click d click. Vim had the same feature within a year. Put
in your .vimrc to enable it. Now vim was already doing something
xterm-like with the mouse. drag d selects the stuff you dragged over
and deletes it. If you were already used to that, hold Shift
while you do it. No-shift and you get the new behavior.
Meanwhile, the curses-based Elvis doesn't have the feature any more.
While you're editing .vimrc, don't forget
to fix some vi peeves and get color-highlights in many languages
and config files.
Debian-related: Vim features can be selected or deselected at
compile time. They are grouped into five bundles, ranging from
tiny vim, not much more than Berkeley vi, to huge vim with
the X11 GUI and Perl and Python scripting. The default vim
in Etch was made with mouse integration turned off. :-(
Maybe that's why more people don't know about it.
So be sure to install the vim-full package if you want vim
to work right in xterm and PuTTY. Or compile it from source
with all the defaults. (you'll need libncurses5-dev)
Works right out of the box, installs politely in /usr/local,
no muss no fuss.
slrn uses the mouse in an xterm too. BTW colorized ls(1) and
black on white xterm don't play well together. Try
xterm -bg black -fg white -cr green -sb -sl 900 -font fixed