Intro to Emacs

Emacs is a wonderful, powerful text editor, but it can take some getting used to. Here are some of the commands you need to know to go from n00b to a text-editing ninja:


Taken from my answer to this question

Key: C = Ctrl, M = Esc. (Protip: if you are a heavy emacs user, switch your caps lock key to an esc key to make the commands a lot easier)

Basic Text Editing C-space: set mark C-w : Cut M-w : Copy C-y : Paste C-x s : save C-x c : save all and close

Navigating Through a File

M-b : back one word
M-f : foward one word
C-f : forward one character
C-b: backward one character 
C-a : beginning of line
C-e : end of line
C-n : next line
C-p : previous line
M-< : beginning of buffer
M-> : end of buffer   

Using Multiple Files

C-x C-f : find file
C-x b : switch buffer
C-x k : kill buffer
C-x 2 : split-window-vertically
C-x 3 : split-window-horizontally
C-x o : switch window
C-x 0 : kill this window
C-x 1 : kill all other windows

Other Handy Commands

C-s : search
C-r : search backward
M-/ : autocomplete word (based on previous words in the file)
C-x ( : start keyboard macro
C-x ) : end keyboard macro
C-x e: execute keyboard macro.

Learning Yourself

C-h: help
C-h f: describe function
C-h k:describe key

but this is just scratching the surface. If you have any other questions about using emacs, feel free to ask!

  1. jamesgifford reblogged this from glennstovall
  2. brandontreb reblogged this from glennstovall and added:
    Emacs FTW!
  3. glennstovall posted this
Developer, Musician, Freelance Web Developer, and all around nice guy.

Facebook  |  Twitter  |  LinkedIn  |  Forrst  |  GitHub  |  StackExchange

view archive

Ask me anything