[Tutor] Python + editor

alan.gauld@bt.com alan.gauld@bt.com
Tue, 13 Aug 2002 17:55:07 +0100


> > > Ctrl+C,ctrl+V :-);
> > Vim ain't that hard...
> Indeed. Nothing beats yy p . But consider  "selling" a python 
> editor to
> some windows people. CTRL+CV rules for them.

vim does have a tool bar that has the usual cut n paste 
buttons. They even work with the windows clipboard...

> > > Block selection (ctrl+mouse selection).
> There's also Visual mode in Vim 
> 
> Can't beat crtl+mouse selection.

You can use the mouse to select in vim and the 
cut n' paste etc all work as expected...

After dragging with the mouse select the mode:
v = Visual(default)
V = Visual Line(whole lines always selected)
CTRL [vV] = Visual block

> > > Can redefine the print command:
> > I'm sure you can do this in vim, I'm just not sure how.

Just filter the file or region to any external 
command using :}!

> They have a lot of power, but hidden deep inside a dotfile.

Absolutely. Like any powerful tool they aren't really 
intended for casual amateur use.

> OK, we can use gvim but is still hard to do some things like 
> the print command above.

The basic print command is easy redirecting does require 
memorizing a three character string but you could easily 
map it to a hot key!

> And it seems like a skin thing, not fully integrated. 

Au contraire, vim is fully integrated with the operating 
system, its the PC stylec editors that aren't 
integrated, they are monoliths containing everything 
internally!

> Same goes to emacs-X11.

It is a hybrid, it has a lot internally but has access 
to the OS too.

> Sure vim can do a lot of things, but the learning 
> curve is too steep.

Too steep depends on whether the learner expects to 
be using it much. If they are only learning for 
occasional use or a one off course then I'd agree 
and let them use IDLE or Pythonwin. But if they 
expect to become professionals someday learning 
vim will repay the effort many many times over!

> after some time and u need the work done.Quick.

vim does most of the work out of the box
(unlike emacs!) My vimrc file is only about 
10 lines long, my emacsrc is over 200...

> asking how to redefine the print command .Yup, u just lost a 
> customer while you was looking at the docs.:)

But surely redefining the print command is a nonsense, 
the print command prints. WEhat they really want to 
do is output to some other output device/format. 
Thats a Unix philospohy issue not an editor thing... 
OTOH map ain't so hard to do :-)

> You know, life is short.That's why I'm slowly giving up from 
> things like:
> - C/perl ;
> - vi/emacs;

Life is short thats why I stick to those things, 
I don't have time to waste on extra keystrokes!

> experience, something I'm experimenting right now with 
> GNU/linux and python.And nedit of course :) .

Get a modern Mac. My iBook with Mac OS X has convinced me 
that Linux has so far to go I can't be bothered waiting!

Alan g