[Idle-dev] newbie question: getting emacs keybindings in IDLE

Ron MacNeil ronmac at media.mit.edu
Sat Oct 22 02:06:17 CEST 2005



Kurt B. Kaiser wrote:

>Ron MacNeil <ronmac at media.mit.edu> writes:
>
>  
>
>>I am using IDLE version 1.1.1 in python 2.4.1 and would like to add
>>the simplest emacs keybindings like C-p for 'move up one line', C-f
>>'move forward a character'... C-n 'move down a line'... etc....
>>
>>Can you please point me to some approach that will do this? I've
>>tried to edit the existing IDLE keybindings but didn't really get
>>very far (kept banging into C-f being bound to Find even though I
>>removed all references to it in config-keys.def.... etc ) I also
>>have tried using XEmacs and find the lack of color a real pain.
>>I've searched the web for emacs keybindings for IDLE and found some
>>interesting pointers but have not got anything to work..
>>    
>>
>
>Simple cursor movement in IDLE is done via the tkinter/Tk library.
>IDLE doesn't have virtual events that can be bound to <cursor-left>
>and so forth.  So there isn't any simple way to do what you are asking.
>  
>

is there any way to, even in a convoluted way, map "what the left arrow 
key does" or "move cursor left one space"  to C-b?

>I think most emacs users these days use the arrow keys, I certainly
>do.  Control-f etc. were useful in the olden days when many keyboards
>didn't have cursor keys.  Unlike the old Wordstar sexd cursor movement
>keys, they aren't particularly convenient bindings.  I'm not going to
>type a chord just to move a cursor, especially now that the Control
>key is no longer where god intended it to be.
>  
>
God would be happy typing on my keyboard... I used keyRemap to put the 
control key under my left thumb...
I've gotten very used to moving the cursor with those few commands when 
I'm working hard on just a local area of code..
moving my hand away to get to the arrow keys is just not quite it... 
anyway...

>Note that Control-left and Control-right moves by words (in a peculiar,
>but useful way).  Control-up and down move by blank-line separated
>blocks.
>  
>
>The way to modify IDLE keybindings is to use the Options / Configure
>IDLE / Keys dialog.  You "Save as a New Custom Key Set".  This creates
>a config-keys.cfg file in your .idlerc directory.  You shouldn't
>modify config-keys.def, that's intended to be "factory issue".
>  
>
right... I had saved the original config-key.def and now made custom 
config-keys.cfg...
thanks much...
cheers, ronmac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/idle-dev/attachments/20051021/ce116680/attachment.htm


More information about the IDLE-dev mailing list