Skip to main content

Emacs Editor Keybindings in the RStudio IDE

Comments

12 comments

  • Clark Richards

    This is a happy day! Thank you for adding this!

    0
  • Clark Richards

    Thanks again for adding emacs keybindings. A couple things I've noticed:

    • the "undo" keybinding is only bound to C-x u. My fingers know one of the other aliases, C-S-_ (I like it because it doesn't require consecutive key hits), but when I tried modifying the shortcut, it doesn't work. In fact, after changing the "Undo" shortcut to C-S-_ and then closing and opening the preference pane, my custom shortcut gets changed to Ctrl+Shift+Insert

    • I've noticed an inconsistency with killing and yanking lines, i.e. doing C-k followed by C-y. In Emacs, consecutive applications of C-k will keep adding to the kill ring (provided no other command interrupts the killing), so that C-y will yank them all back together. For example, I might use C-k to kill 3 consecutive lines, and then yank them all back with a single C-y. However, in RStudio, only the last killed line gets saved to the kill ring.

    0
  • Kevin Ushey

    Hi Clark,

    Thanks for the feedback! I'll see what's going on re: the remapping from _ to Insert.

    The kill + yank behaviour is also currently suboptimal; the 'kill ring' is not yet fully implemented. We mostly borrow this functionality from the Emacs mode that's bundled with the Ace editor (http://ace.c9.io/#nav=about), but I'll see if we can either patch RStudio to implement this or else get changes adopted upstream in Ace as well.

    Thanks,
    Kevin

    0
  • Wenjian Yang
    This is very helpful. Thanks!! However, on Windows OS, the Alt key does not work as the Meta key. For example, "M-f" (Alt-f) will open the "File" menu instead of moving forward by word. Is there anyway to use Alt as Meta in Windows? Using 0.99.837. Thanks.
    0
  • William Murrah

    I love the emacs keybindings, but C-f opens the find pane inside the editor instead of moving the point forward. I there a way to change that?

    0
  • Kevin Ushey

    Hi William,

    Thanks for pointing this out -- I've logged an issue internally and we'll try to get this fixed soon.

    Best,
    Kevin

    0
  • Jonathan Steinhart

    THANK YOU THANK YOU THANK YOU! :D

    RStudio was already such a big leap up in productivity for me from Emacs/ESS that I have been using it almost exclusively for some time; but this was the one gripe I still had (old habits dying hard and all). Thanks so much for actually implementing this!

    0
  • Jared Studyvin

    C-c C-n does NOT evaluate the current line/section, in fact C-c does not seem to be working at all. I'm using the current version of rStudio. C-r does evaluate the line but that should be search in reverse for emacs keybindings.

    0
  • Kevin Ushey

    Hi Jared,

    Thanks for reporting the issue -- we'll investigate what's going on.

    Best,
    Kevin

    0
  • ethan xu

    THANK YOU! I remembered asking for emacs key bindings in 2014 JSM at RStudio booth. It's finally here:)

    Will full custom key settings happen in the future?

    0
  • Jonathan Gilligan

    On Windows, what key acts as "meta"? Neither "alt" nor "esc" seem to work as meta.

    0
  • Elpo Ghash

    Ubuntu 16.10 "M-b, M-f to move left and right by words" don't work, as they open the Build and File menus. Would it be possible to fix this?

    0

Article is closed for comments.