Emacs is a text editor that helps manage, edit, revise, compile, test, debug, and run the several code and data files required in real data analysis.

"C-" (control) means "hold down Ctrl key"
"M-" (meta) means "hold down Alt/Option key", or "press and release Esc key"
Category Command Keystrokes Mnemonic
Start/Stop start emacs (in Terminal) emacs -nw  
exit emacs C-x C-c  
Files read a file into Emacs C-x C-f find
create a new file (name it as if it exists) C-x C-f  find
insert a file C-x i insert
save C-x C-s save
save as ... C-x C-w write
Cursor Motion forward (right arrow) C-f forward
backward (left arrow) C-b backward
down (down arrow) C-n next
up (up arrow) C-p previous
jump to start of line C-a a = start alphabet
jump to end of line C-e end
jump to start of buffer (a "buffer" holds a file's text or a directory listing, etc.) M-< < = left
jump to end of buffer M-> > = right
Cut, Copy, Paste

"kill" = "cut", "yank" = "paste"

delete current character C-d delete
delete previous character Backspace  
kill to end of line (twice to include newline) C-k kill
set mark; "region" is between invisible "mark" and "point" (cursor) C-SPACE  
kill region C-w  
copy region M-w  
yank back last thing killed C-y yank
replace last yank with previous kill M-y  
kill, yank rectangle region C-x r k, C-x r y  
Formatting indent current line TAB  
indent buffer M-x indent-region
 
fill paragraph M-q  
Error Recovery abort partially typed or executing command C-g  
undo an unwanted change C-_ or C-/  undo
restore buffer to original contents M-x revert-buffer  
The Minibuffer complete as much as possible TAB  
Type C-x ESC ESC to repeat the last command that used the minibuffer. Then the following keys are defined. previous minibuffer command M-p previous
next minibuffer command M-n next
Multiple Buffers make one buffer C-x 1 one
split buffer vertically C-x 2 two
split buffer horizontally C-x 3  
switch to other buffer C-x o other
Resize buffers: wider, narrower, taller
(Each can use a prefix argument via C-u; e.g. C-u -10 C-x ^ goes taller -10 lines.)
C-x }
C-x {
C-x ^
right
left
up
Buffers list buffers  C-x C-b buffer
visit a buffer from the buffer list type SPACE (or f) on the buffer's line find
close a buffer C-x k kill
go to shell buffer M-x shell  
Incremental Search
Then type a word for which to search. Use C-s or C-r again to repeat the search in either direction.
search forward C-s search
search backward C-r reverse
regexp search forward C-M-s or C-M-S  
regexp search backward C-M-r or C-M-R  
exit search Enter  
find all occurrences M-x occur  
Query Replace
yes = "y" or SPACE, no = "n"
interactively replace text M-% (or M-x query-replace)  
interactively replace regexp M-x query-replace-regexp  
Regular Expressions for search and query replace See this summary of regular expressions and the manual    
Directory Editor to list and manage files
find directory (C-x C-f . ), then "?" for help
delete (rather, mark for deleting) d  
undelete (rather, unmark) a file u  
expunge (delete files marked for deleting) x  
find f  
rename R  
copy C  
create directory +  
refresh directory g  
R start R buffer M-x R
run one line of R code C-c C-n from within a ".R" file
run chunk of R code C-c C-c chunk
run buffer of R code C-c C-b buffer
show documentation for R mode (ESS) M-x help Enter m
Help help M-x help help
show function a key runs M-x help Enter k [key sequence] key
tutorial M-x help Enter t tutorial

To learn more, visit Emacs Tour, Emacs Reference Manual, Emacs FAQ.