Emacs Command Summary



next up previous contents index
Next: X-Mouse FunctionsEmacs Up: Editing with Emacs Previous: Editing with Emacs

Emacs Command Summary

 

UNDO, HELP - how to get out of a bind
BUFFERS - file control when working with multiple files
MOVEMENT - cursor control
MARKS and REGION - for use with cut and copy
DELETION AND KILLING
WORD PROCESSING - convenient tricks and time savers
Modes - set Emacs for the programming or mark-up language you need


emacs SPECIAL CHARACTERS
^ x (c-x)
Press control key while typing x.
m-x (~ x)
A meta-x,
press Meta, Alt, or Option while typing x.

emacs UNDO, HELP
^ x u (^ _)
UNDO last command (repeatable).
^ g
ABORT command in process.
^ h
HELP.
^ h t
Tutorial.
^ h a subject
Help APROPOS subject.
[tab]
Emacs finish command, or give possibilities.
^ x^ c
EXIT Emacs with queries.
^ y
YANK back deleted text.
~ y
YANK back earlier deleted text.

emacs ENTERING FILES, EXITING
emacs filename
START Emacs from Unix with file filename.
emacs +n filename
START Emacs from Unix at line n of filename.
^ x ^ f filename
FIND (open) file filename.
^ x ^ f dirname
FIND and list directory dirname.
^ x 4 ^ f filename
FIND (open) file filename in new window.
^ x^ r filename
READ file filename to active buffer.
^ x i [ret] filename
INSERT file filename into buffer.
^ x ^ s
SAVE file from active window (buffer).
^ x s
SAVE some file from inactive window (buffer).
^ x^ w filename
WRITE active buffer into file filename.
^ x^ c
EXIT Emacs with queries.

emacs BUFFERS

^ x ^ b
List BUFFERS,
then 1 selects highlighted buffer.
^ x b buffername
Switch to buffername.
^ x 4 b buffername
Switch to buffername in separate window.
^ x k
KILL active buffer.
^ x ^ v
KILL active buffer, find alternative.
^ x ^ c
QUIT Emacs.

emacs WINDOWS
^ x 2
SPLIT display into 2 horizontal windows.
^ x 5
SPLIT display into 2 vertical windows.
^ x 1
Collapse display into ONE window.
^ x 0
Kill (ZERO) inactive window.
^ x o
Make OTHER window active.
^ x p
Make PREVIOUS window active.
^ x ^ (caret)
Open active vertical window HIGHER.
^ x }
Open active horizontal window WIDER.

 
Figure 1.3: Emacs movement commands for differing objects. 


emacs MOVEMENT (Figure 1.3)
^ f
FORWARD a character.
^ b
BACKWARD a character.
^ n
NEXT line.
^ p
PREVIOUS line.
~ f
FORWARD a word.
~ b
BACKWARD a word.
^ a
Beginning (ALPHA) of line.
^ e
END of line.
~ a
Beginning (ALPHA) of sentence.
~ n
Beginning of (NEW) paragraph.
~ p
End of PARAGRAPH.
~ 99 ^ l
LINE 99.
~ 99
Enter 99 as ARGUMENT.
~ x goto-line [ret] 99
LINE 99.
~ x goto-char [ret] x
CHARACTER x.
~ < (meta <)
BEGINNING of file.
~ >
END of file.
^ v
FORWARD 1 screenful.
~ v
BACKWARD 1 screenful.
^ ~ v
Forward in inactive window.
^ l (el)
RECENTER (cursor on same character).
~ l (el)
Change next word to LOWERCASE.

emacs POSITION IN FILE
~ what-page
PAGE & Line.
~ what-line
Show what line cursor is on.
^ =
Show cursor position.


 
Figure 1.4: Emacs ``region'' definition and commands. 


emacs MARKS and REGION (Figure 1.4)
^ [space] (^ @)
Set MARK at cursor.
cursor
REGION = mark - cursor position (new).
^ x ^ x
EXCHANGE mark and cursor (i.e. check region).
^ w
Cut (KILL) region (WORLD) to clipboard.
~ w
COPY region (WORLD) to clipboard; no delete.
^ x [Tab]
Indent region.

emacs SEARCH AND REPLACE
^ s word
Incremental SEARCH forward for word;
end with [esc] or click, continue with ^ s.
^ s
Continue SEARCH forward.
^ r
REVERSE search.
[esc]
End search (or some other commands).
[bs]
Move back in search.
^ r word
REVERSE search for word.
^ s
Continue search forward.
~ x occur [ret] expression
List all OCCURRENCES of expression,
cursor on line in occur-buffer, ^ c ^ c to find.
~ x search-forward [ret] word [ret]
Non-incremental SEARCH.
~ %
Synonym for ~ x query-replace.
~ x replace-string[ret] old [ret] new
REPLACE ALL old with new.
~ x query-replace [ret] old [ret] new
REPLACE after QUERY oldwith new, Emacs asks.
y, n, [esc], ,
Your replies: yes, no, quit, yes+stop (= ,).


 
Figure 1.5: Emacs deletion commands for differing objects. 


emacs DELETION AND KILLING (Figure 1.5)
[bs]
DELETE character BEFORE (left of) cursor.
^ d
DELETE character AFTER cursor.
~ [bs]
DELETE word BEFORE cursor.
~ d
DELETE word AFTER cursor.
^ k
KILL & store from cursor to end of line.
~ k
KILL to end of sentence.
^ w
CUT & store region (WORLD) to clipboard.
~ w
COPY region (WORLD) to clipboard; no delete.

emacs CUT AND PASTE
^ k
KILL & store from cursor to end of LINE.
~ k
KILL to end of SENTENCE; stored on clipboard.
^ w
Cut (KILL) region (WORLD); stored on clipboard.
~ w
COPY region (WORLD) to clipboard.
~ ^ w
Append kill to previous kill on clipboard.
^ y
Paste (YANK) text of last kill (from clipboard).
~ y
Paste (YANK) text of PREVIOUS kill.

emacs WORD PROCESSING
~ q
FILL paragraph containing cursor.
~ g
FILL region (mark - cursor).
~ 1 ~ q
Fill and right JUSTIFY paragraph.
^ o (oh)
OPEN a blank line here.
^ x ^ o
DELETE multiple OPEN (blank) lines.
~ u
UPPERCASE next word.
~ l
LOWERCASE next word.
~ c
CAPITALIZE next word.
^ x ^ u
UPPERCASE region.
^ x ^ l
LOWERCASE region.
^ t
TRANSPOSE letters.
~ t
TRANSPOSE words.
^ x [tab]
INDENT region.
~ $
SPELLcheck last word.
~ x spell-buffer
SPELLcheck buffer.
~ x spell-region
SPELLcheck region.



next up previous contents index
Next: X-Mouse FunctionsEmacs Up: Editing with Emacs Previous: Editing with Emacs