Home University at Albany University at AlbanyUAlbany Site IndexUAlbany Search
UNIX

Print Friendly



Moving Around in Emacs


As you type, the cursor always stays in front of (that is, to the right of) each letter that appears. The cursor points to your current position on the screen. Knowing the location of the cursor is important because any text you type will be entered at the position of the cursor, and any of the editing commands you perform are executed at the position of the cursor.

The following table contains several useful key commands for navigating and issuing special commands in Emacs. (Most terminal emulators allow use of the arrow keys for moving the cursor.)

 

Keyboard Cursor Control

Useful Key Commands

CTRL-p

Previous line

CTRL-x CTRL-s

Save your file

CTRL-n

Next line

CTRL-x CTRL-c

Exit emacs

CTRL-f

Forward one character

CTRL-l

Redraw screen

CTRL-b

Backward one character

CTRL-g

Abort command

META-f

Forward one word

CTRL-x I

Insert a file

META-b

Backward one word

DELETE

Deletes character to left of cursor (if keys are mapped properly)

CTRL-a

Beginning of line

CTRL –d

Deletes character to right of cursor

CTRL-e

End of line

META-DELETE

Kills back to beginning of a word

META-a

Beginning of sentence

META-d

Kills up to the end of a word

META-e

End of sentence

CTRL-k

Kills to the end of a line

CTRL-v

Move forward one screen

META-k

Kills to the end of current sentence

META-v

Move backward one screen

CTRL-y

Yanks back most recent killed item

   

META-y

Cycles through stored killed items

   

CTRL-x u

Reverse most recent editing change

 
** Note: Most ordinary keyboards do not have a "meta" key. Use the ESC key instead. M-x or META-x means press the ESC key, release it, and press the "x" key. **