oh sh*t - what to do if you've screwed something up
================================================================================
C-_ undo (undo)
C-g abort command sequence (keyboard-quit)
C-x C-c quit (save-buffers-kill-terminal)
M-x menu-bar-mode RET toggle the menu bar on or off (menu-bar-mode)
M-x revert-buffer RET reload current buffer from disk
C-x C-s save the current file
files, buffers & windows
======================================================================
C-x C-f open or create a file (open)
C-x C-s save the current file/buffer
C-x C-w save as
C-x k kill (close) a file/buffer
C-x b switch to another buffer/window
C-x C-b list all open buffers/windows
C-x 2 split window horizontally
C-x 3 split window vertically
C-x 0 kill (close) other window
C-x 1 kill (close) this window
search and replace
======================================================================
C-s search (isearch-foward)
C-s next match; use twice to repeat last search
C-r previous match
RET stop here
C-g stop and go back to starting location
M-% find & replace (query-replace)
C-M-% regexp find & replace
y replace current match
n skip current match
! replace all
RET stop here
C-g stop and go back to starting location
coding
======================================================================
M-g g goto line
M-; comment/uncomment selection
C-M-\ re-indent (reformat) selection
spelling
======================================================================
M-x flyspell "live" spellchecking (flyspell)
M-$ spell check (ispell-word)
bookmarks - C-x r
======================================================================
C-x r m set a bookmark at the current location (e.g. in a file)
C-x r b jump to a bookmark
C-x r l list your bookmarks
a show annotation for the current bookmark
A show all annotations for your bookmarks
d mark various entries for deletion (‘x’ – to delete
them)
e edit the annotation for the current bookmark
m mark various entries for display and other operations,
(‘v’ – to visit)
o visit the current bookmark in another window, keeping the
bookmark list open
C-o switch to the current bookmark in another window
r rename the current bookmark
M-x bookmark-delete delete a bookmark by name
shell
======================================================================
M-! run a shell command
M+x shell open a shell buffer
C+u M+x shell open a new shell buffer
M+x term open a terminal emulator
C+u M+x term open a new terminal emulator
misc
======================================================================
C-x C-+ increase font size; C-+ to repeat
C-x C-- decrease font size; C-- to repeat
help
======================================================================
C-h b list all key bindings
C-h w <function> list all key bindings for <function>
C-h c <sequence> list function bound to <sequence>
C-h k <sequence> show help for function bound to <sequence>
C-h i show help/tutorial (Use C-x k to close it)
notes
======================================================================
C-x means "Control-x"
M-x (usually) means "Alt-x"
S-x means "Special-X", typically "Windows-X" (or clover-X on Apple?)
Key bindings can be changed by your .emacs file and the major- or
minor-mode you are in. They could be different than what you see here.
more cheat sheets and help
======================================================================
cheat emacs-ruby
cheat emacs_tips
http://www.gnu.org/software/libtool/manual/emacs/
http://refcards.com/docs/wingb/xemacs/xemacs-refcard-a4.pdf
http://www.stevenchan.us/files/Notesheet-Emacs.pdf
https://ccrma.stanford.edu/guides/package/emacs/emacs.html
http://www.rgrjr.com/emacs/emacs_cheat.html