6

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?

stevec
  • 41,291
  • 27
  • 223
  • 311
Brand
  • 1,681
  • 1
  • 24
  • 32

2 Answers2

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

Moiz Raja
  • 5,612
  • 6
  • 40
  • 52
  • 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. – d11wtq Oct 20 '11 at 13:50
6

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.
egor7
  • 4,678
  • 7
  • 31
  • 55
Anurag
  • 176
  • 1
  • 5