Search code examples
keyboard-shortcutspharo

How to get emacs-like keybindings in Pharo?


I've downloaded Pharo today, and I noticed most keybindings don't work within the language environment. Is there any possible way to get standard Mac / Linux keybindings to work?

I could find no answer searching on Google.

I'd appreciate if someone could tell me how to configure the standard

Ctrl+a, BeginningOfLine
Ctrl+e, EndOfLine
Ctrl+d, forwardDelete
Ctrl+f, forwardChar
Ctrl+b, backwardChar
Ctrl+n, nextLine
Ctrl+p, previousLine

to work on Pharo 5.0.


Solution

  • If by "standard" you mean "emacs-like keybindings" then no, Pharo does not support such scheme nor is there an easy way to change them.

    You could change some of the hard-coded shortcuts in places like the PharoShortcuts and RubSmalltalkEditor class>>buildShortcutsOn: (which powers the Playground). However there are very likely more places (e.g. Nautilus).

    Several of the shortcuts you mentioned are also core shortcuts for Pharo (in the sense that you can execute them pretty much anywhere you can type text), namely:

    • ctrl+p for printing the selection
    • ctrl+d for doing (executing) the selection
    • ctrl+n browsing senders of the highlighted selector

    Furthermore ctrl+a is "select all" as in pretty much every text editor, and ctrl+f find.

    However, there is an ongoing effort to cleanup the shortcuts and unify them into single place (PharoShortcuts), so in time such change should easily be possible.