Some GNU Emacs hotkeys for ya!

I’ve collected some of the Emacs shortcuts / keyboard hotkeys I find myself using from time to time! 😉

Please visit:
GNU Emacs for Unix/Linux and precompiled Windows binaries
Aquamacs for OS X (I prefer this over http://emacsformacosx.com/ as it is better integrated)

To get a hold of this incredible “editor”. The reasons I write “editor” is because calling Emacs an editor is something of an understatement! It’s more like a little operating system or at least an intelligent Lisp world!

For you guys never bothered to learn Emacs: You don’t know what you’re missing out on!

Ok, here are the hotkeys (feel free to add some as a comment, and I’ll add them to the list!):

General commands:

c-x c-f = new buffer (file)
c-x c-c = quit
c-g = cancel input command
c-v next page
m-v previous page
c-l toggle cursor point up/down/center (pgUp/pgDown)

Navigation in text:

c-p = previous line
c-n = next line
c-b = backward
c-f = forward
m-f = move forward Word-by-word
c-a = beginning of the line
c-e = end of the line
m-a = beginning of the sentence
m-e = end of the sentence

m-< = beginning of the text
m-> = end of the text

Editing Text

Killing text:
(text goes to a safety buffer like in Cut)

m-backspace = kill word before cursor
m-d = kill word after cursor
m-k = kill words until end of sentence (.)
c-k = kill words until end of line
c-space = mark start of delete (move to end of text to delete)
c-w = delete text from mark until here
c-y = yank (paste) text from last kill buffer
m-y = cycle through the kill buffer entries

c-x u = undo
c-_ = undo too!

Search for text:
c-s = search forward in buffer from cursor
c-r = search backwards in buffer from cursor

for a non-interactive search press enter before search word.

Search and replace:
m-x replace-string + enter
<word to replace>
<word to replace with>

Managing buffers and windows

c-x c-b = display buffer list
c-x o = switch to buffer list, select with arrows and enter
c-x b = start typing the name of the buffer to choose (tab-complete)

c-x 1 = one buffer in window
c-x 2 = two buffers in window horizontal
c-x 3 = two buffers in window vertical

c-x 0 = close active buffer (file)

m-x recover-file = recover file after crash (open original file, not auto-backup)

c-u 90 c-x f = set margin width to 90 chars

c-u 0 c-l = move current line to top of buffer window
c-x o = move cursor to “other” buffer window
c-m-v = scroll through other window (keeping cursor in main window)

m-x make-frame = create an independent Emacs frame

esc esc esc = get out of recursive editing level mode

c-h f <function> = help on <function>
c-h k <command> = help on <command>
c-h a <keyword> = search for <keyword> in help
c-h i m Emacs = read Emacs manual using info

That is something to get you started!

Until next time, happy editing!

Chris

Advertisements

One thought on “Some GNU Emacs hotkeys for ya!

Comments are closed.