[an error occurred while processing this directive]

Essential Emacs Commands

Use "emacs foo" to create a file named foo, or to edit an existing file named "foo". You can do some work just by typing in the window once emacs comes to life. The backspace or delete key should do what you think it does.

In the list below, C- means "control key", M- means "meta key" (escape). For meta commands, press the meta key, then the other key. Thus M-f stands for the keyboard sequence "press meta key", " press f".


  C-x C-s      Save file
  C-x C-f      Find (open) file.  Emacs asks for file name at bottom of screen.
  C-x C-z      Leave emacs temporarily (return with "fg" ("foreground"))
  C-x C-c      Quit emacs

  C-g          Abort command (get out of trouble)

  C-f          Move cursor Forward one character
  C-b          Move cursor Backwards one character

  C-n          Move cursor to Next line
  C-p          Move cursor to Previous line
  C-a          Move cursor to beginning of line
  C-e          Move cursor to End of line

  C-v          Go forward one screen
  M-v          Go backward one screen

  C-k          Kill text from cursor to end of line.  (Cut text out)
  C-y          Yank back killed text. (Paste text in)

  C-l          Redisplay the screen if it is garbled.

  M-f          Move cursor forward one word
  M-b          Move cursor backwards one word
  M->          Move to end of file
  M-<          Move to beginning of file

  C-u 7 C-n    Move forward 7 lines
  C-u 10 C-p   Move back 10 lines

Emacs has an excellent on-line help tutorial. To use it, start up emacs. When you are "in emacs", type C-h, then type the letter "t". Follow directions. When you wish to leave the tutorial, type C-x C-c.

Many keyboards have "arrow" keys. These move the cursor around in the expected way.

last modified on Wednesday, 02-Feb-2005 19:07:03 EST
[an error occurred while processing this directive]