+ Reply to Thread
Results 1 to 8 of 8

Thread: How to customize key bindings of Rhino Python editor

  1. #1
    New Member
    Join Date
    Apr 2012
    Location
    Kamakura, Japan
    Posts
    12

    How to customize key bindings of Rhino Python editor

    Hi,

    Is there a possibility to customize the key bindings of the Rhino Python editor?

    I am used to MAC/emacs key bindings.
    Without them I feel as clumsy as somebody using a computer for the first time in his life...

    Thanks, Dietrich

  2. #2
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    Hi Dietrich,
    No there aren't custom key bindings right now, but they shouldn't be too hard for me to add. Is there any ones in particular that are making you the most "clumsy"?
    Thanks,
    -Steve

  3. #3
    New Member
    Join Date
    Apr 2012
    Location
    Kamakura, Japan
    Posts
    12
    Hi Steve,

    I am impressed by your fast and positive reaction

    As I fear that different people have different preferences, the best might be some kind of profile, which can be adapted to the personal needs of the user. There might be a set of default profiles to select from for further customization: One for Windows, one for Mac, another for Emacs, ... Sometimes even the same user might want to switch between different profiles for different tasks.

    Unfortunately, habits tend to be "hard-wired" and therefore unconscious, difficult to change, and even more so to argue about. I remember that I once searched for an available control sequence and noticed to my own surprise, that I was actually using most of them already, without knowing about it. So again, I suppose that the only way to not make others angry is to give everybody the possibility to customize them

    Thanks again for your positive attitude

    Dietrich

    ---
    I suppose the following are those I normally use - with the most important ones marked by an asterisk:

    To move the cursor:

    * C-f next char
    * C-b previous char
    * C-n next line
    * C-p previous line
    * C-a begin of line
    * C-e end of line

    M-f one char after end of next (or current) word
    M-b start (first character) of previous (or current) word

    To delete / yank:

    * C-h delete previous char
    * C-d delete next char
    * C-k delete all text up to the end of line;
    when already at the end of line, delete line itself
    (hitting C-k once deletes an empty line;
    hitting C-k twice deletes a non-empty line)
    C-y fill in the last deleted text
    (for example those three lines
    deleted with C-a, C-k, C-k, C-k, C-k, C-k, C-k)
    C-w delete current region
    M-d delete next word

    Others:

    * C-j enter/return
    C-l center the text so that the number of shown lines
    before and after the cursor are more or less the same
    * C-s search / find
    C-r search / find backward

    Some of them conflict with other keybindings, the most important one probably being C-f...

  4. #4
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,464
    Blog Entries
    19
    Excuse my ignorance; I haven't used emacs ever on Windows (only on unix/linux systems a long time ago). Is C supposed to stand for the CTRL key on the keyboard or is that the letter C and emacs is in the mode where you are navigating around the document?

    Thanks,
    -Steve

  5. #5
    New Member
    Join Date
    Apr 2012
    Location
    Kamakura, Japan
    Posts
    12
    Hi Steve,

    Sorry! Yes, you are right, I used C for CTRL and M for the ALT / OPTION key, which is sometimes called META in Emacs talk...

    There is only one mode in Emacs. Different modes (Command mode, Insert mode, Line mode) are used in the case of vi.

    Here an example how the CTRL keystrokes are used during the editing process:

    When you type something like
    Code:
    r a i CTRL-b CTRL-h h CTRL-e n o CTRL-j 3 d
    the result would be:

    Code:
    rhino
    3d
    As:
    Code:
    r       # insert 'r'
    a       # insert 'a'
    i       # insert 'i'
    CTRL-b  # move cursor one position backward
    CTRL-h  # delete the character before the cursor
    h       # insert 'h'
    CTRL-e  # goto end of line
    n       # insert 'n'
    o       # insert 'o'
    CTRL-j  # same as [return / enter]
    3       # insert '3'
    d       # insert 'd'
    I hope that helps?

    Cheers,

    Dietrich

  6. #6
    So, if you consider emacs keybindings, would you please give vim key bindings for a consideration?

  7. #7
    New Member
    Join Date
    Apr 2012
    Location
    Kamakura, Japan
    Posts
    12
    Hi,

    Any news concerning the emacs / mac key-bindings for the rhino python editor?

    Is there a way to configure the key-bindings myself?

    Thanks,

    Dietrich

  8. #8
    New Member
    Join Date
    Apr 2012
    Location
    Kamakura, Japan
    Posts
    12
    Hi again,

    Another way to solve the problem would be to "hit" the "Start Debugging" (...execute the script) botton from emacs, or better: to remote control rhino from some other script / program

    Is this possible?

    I then could implement something like this:

    When hitting some special "execute" key in emacs, the file would be saved, emacs would execute some script like "rhino-remote-control 'load file xxx and execute it in rhino'" and I could see the result of my script in the Rhino window. Of course it would be even better if the "rhino-remote-control" script would return some feedback, ideally the same thing a python shell would return when executing the commands...

    (I actually implemented something similar some years ago for Blender: http://www.formgames.com/blender/command-port/ - and searching for this I found out, that I already posted the same question here: http://python.rhino3d.com/threads/98...o-Command-Port and got an answer (negative) already - Hm... Maybe there are any news concerning this topic? At least the two threads are related now...)

    Thanks, Dietrich

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts