Keyboard shortcuts to navigate the command line in irb
Asked Answered
E

2

7

I've seen screencasts where users are running irb and as they write text they jump to the beginning/end of the line and beginning/end of words. What are the keystrokes used to do this? Does it depend on the shell that's being used?

Erythro answered 20/10, 2011 at 13:28 Comment(0)
D
8
Ctrl + A => Move to beginning of line
Ctrl + E => Move to end of line 

These are readline commands

Here is a cheatsheet you may find helpful in general

Dorinedorion answered 20/10, 2011 at 13:37 Comment(1)
Emacs keyboard shortcuts are really handy to learn. I just realized today that some of them work on OS X Lion's own native Cocoa apps, such as Mail.app too.Nicolette
S
8

Those are readline shortcuts. Some of the shortcuts I regularly use:

Ctrl + a => End of line
Ctrl + e => Start of line
Ctrl + l => Clear screen
Ctrl + k => Cut text from cursor position till end of line
Ctrl + u => Cut text from cursor position till start of line
Ctrl + y => Paste text that was cut using above two shortcuts
Ctrl + d => Delete a letter after cursor
Ctrl + h => Delete a letter before cursor
Meta + d => Delete the word after cursor
Meta + f => Move cursor one word forward
Meta + b => Move cursor one word backwards.
Superjacent answered 20/10, 2011 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.