For anyone using a Mac, the basic cursor movement commands available in readline and emacs—C-f, C-b, C-a, C-e, C-n, C-p—are also available in virtually any text input in any program, namely web browser inputs, url bars, and textareas, as well as all system UIs. Once you get used to using these shortcuts that means you can compose and edit text anywhere without ever moving your hands. I recently switched to using Linu…
Keyboard shortcuts for GNU Readline
31–40 of 174 posts
Re: Keyboard shortcuts for GNU Readline
#32> C-e, C-f, M-b, M-f Why these strange shortcuts when any keyboard has arrow keys and they can be used with a control modifier to move by words? I can understand why to use C-a, C-e, because laptop keyboards tend to have "Home" and "End" keys in strange places, but those... And Emacs documentation for some reason insists on using C-e, C-f instead of arrow keys.
Re: Keyboard shortcuts for GNU Readline
#33Knowledge like this used to spread naturally—physically sitting with a junior engineer, muscle memory would make any shortcut-fu gaps painfully clear. That’s not as visceral in remote pairing, and doesn’t show up at all in async processes like CR. Still, I try to at least share the “greatest hits”: ctrl-r: search backwards through command history ctrl-a: go to beginning of line ctrl-e: go to end of line If nothing el…
In ~20 years of professional programming, I have never explored much beyond these shortcuts, except for also using: * ctrl-left/ctrl-right to go back/forward word by word instead of char by char * ^C to cancel the current line
* ^D - Send EOF, which exits most shell-like programs (if you're on an empty line, so try ^C^D)
And the job control bindings: * ^Z - Suspend current foreground process and return to shell, use `fg` to resume it in foreground and `bg` to resume it in background (see also `disown`)
* ^S - "Stop" current process, useful if it's printing a lot of stuff and you want to pause it for a bit, otherwise useless and usually done by mistake
* ^Q - resume a stopped process, probably after you ^S'ed by mistakeRe: Keyboard shortcuts for GNU Readline
#34> C-e, C-f, M-b, M-f Why these strange shortcuts when any keyboard has arrow keys and they can be used with a control modifier to move by words? I can understand why to use C-a, C-e, because laptop keyboards tend to have "Home" and "End" keys in strange places, but those... And Emacs documentation for some reason insists on using C-e, C-f instead of arrow keys.
Re: Keyboard shortcuts for GNU Readline
#35For anyone using a Mac, the basic cursor movement commands available in readline and emacs—C-f, C-b, C-a, C-e, C-n, C-p—are also available in virtually any text input in any program, namely web browser inputs, url bars, and textareas, as well as all system UIs. Once you get used to using these shortcuts that means you can compose and edit text anywhere without ever moving your hands. I recently switched to using Linu…
Command-A isn’t available on Linux in slack? How do people even function without basic function keys?
Re: Keyboard shortcuts for GNU Readline
#36> C-e, C-f, M-b, M-f Why these strange shortcuts when any keyboard has arrow keys and they can be used with a control modifier to move by words? I can understand why to use C-a, C-e, because laptop keyboards tend to have "Home" and "End" keys in strange places, but those... And Emacs documentation for some reason insists on using C-e, C-f instead of arrow keys.
fn+left/right -> home/end
fn+up/down -> page up/down
It's probably been 20 years I have laptops that support it and I'm perfectly fine/fast to manipulate text with the keyboard.
Re: Keyboard shortcuts for GNU Readline
#37Always makes me giggle.
Re: Keyboard shortcuts for GNU Readline
#38> C-e, C-f, M-b, M-f Why these strange shortcuts when any keyboard has arrow keys and they can be used with a control modifier to move by words? I can understand why to use C-a, C-e, because laptop keyboards tend to have "Home" and "End" keys in strange places, but those... And Emacs documentation for some reason insists on using C-e, C-f instead of arrow keys.
There was a time before PC's when keyboards didn't necessarily have Arrow keys
Re: Keyboard shortcuts for GNU Readline
#39For anyone using a Mac, the basic cursor movement commands available in readline and emacs—C-f, C-b, C-a, C-e, C-n, C-p—are also available in virtually any text input in any program, namely web browser inputs, url bars, and textareas, as well as all system UIs. Once you get used to using these shortcuts that means you can compose and edit text anywhere without ever moving your hands. I recently switched to using Linu…
Command-A isn’t available on Linux in slack? How do people even function without basic function keys?
Re: Keyboard shortcuts for GNU Readline
#40> C-e, C-f, M-b, M-f Why these strange shortcuts when any keyboard has arrow keys and they can be used with a control modifier to move by words? I can understand why to use C-a, C-e, because laptop keyboards tend to have "Home" and "End" keys in strange places, but those... And Emacs documentation for some reason insists on using C-e, C-f instead of arrow keys.
You can use the standard keyboard movement keys if you prefer.
(The letters are mnemonics, Back, Forward, Next line, Previous line, End of line, start of line uses A as the first letter. The control key tends to do smaller things (like move one letter or line) while the alt/meta key does bigger or less-common things, like move whole words, sentences or paragraphs. See https://www.gnu.org/software/emacs/manual/html_node/emacs/Mo...)