Emacs Cheatsheet


Table of Contents

Emacs help

C-h bdescribe bindings
C-h fdescribe function
C-h vdescribe variable
C-h mdescribe mode


This list is very miscellanous, see http://orgmode.org

<s TABinserts #+begin_src #+end_src section
<h TABinserts #+begin_html … #+end_html
C-c .insert timestamp
C-c [add file to Agenda
C-c ]remove file from Agenda
C-c C-eOrg export. Brings up menu of options
C-c C-e tInsert Template into org doc
C-c C-e bExport to html and open page in browser
C-c C-e PExport and publish current project
C-c C-e FExport and publish current file
C-c C-e lExport as LaTex file
C-c C-e pExport as LaTex and process pdf
C-c C-e pSame as above … and open pdf
C-c cOrg-capture
C-c ccCapture Calc III assignment
C-c cpCapture Probs and Stats HW.

Info Navigation

Navigating in the Emacs Info Reader

lback in history
pprev node
nnext node
uup a level
<spc>scroll page then first sub-node at end of node

Emacs Macros

C-x (start keyboard macro
C-x )end keyboard macro
C-x erepeat last macro
M-n C-x erepeat last macro n times

More Emacs Commands

C-M ;comment-region
C-u C-M ;un-comment-region
C-M \indent-region
M-PgUpscroll other window up
M-PgDnscroll other window down
C-x fset-column-fill

Dired Commands

mmark file
uunmark file
dmark file for deletion
xexecute deletions
Qregexp search-replace in marked files
Rrename marked files
Zcompress file
~mark all backup files for deletion
#mark all #'d files for deletion
Ochange owner
stoggle sorting by name/date

C-x C-q in Dired mode

also C-x C-q allows you to edit the dired directory as a file, and use macros or string-replace to change lots of file names at once. Use C-c C-c to save changes.

Emacs and Etags

M-.go to function
M-*after M-. go back to where you were.
M-x visit-tags-tableadd TAGS file for source
generate etagsfind . -name '*.java' xargs etags


with Tramp you use the same "write-file" command with keybinding C-x C-w and then give a remote ssh path as the file path

save file to serverC-x C-w
use ssh path to save file remotely/ssh:username@yourserver.org:path/to/file

JDE Keybindings

C-c C-v zadd any needed imports
C-c C-v jadd javadoc comment for class or method
C-c C-v C-ccompile
C-c C-v C-rrun app
C-c C-v C-ddebug app

Magit Control

Magit is an Emacs Mode for interacting with Git Repositories

C-x ggit status
C-c C-cwhen in commit log: commit changes
**Following commands work in git status buffer**
sstage file at point
uunstage file at point
copen commit log
Ppush master origin untracked file section
iadd file to ignore
Iadd file to git/info/exclude
kin unstaged: resets to head. ie discards changes
kin untracked: deletes file
<tab>in staged/unstaged: shows/hides diff of changes
C-u Ppush master to ?: prompts for remote to push changes to
lgit log: hit <enter> on a commit to see changes
=diff current with commit at point
tcreate lightweight tag
Tcreate annotated tag
xprompts for revision resets HEAD to it.

Rinari Keybindings

Rinari is an Emacs Mode for Ruby on Rails projects.

C-c ; f c,rinari-find-controller
C-c ; f e,rinari-find-environment
C-c ; f f,rinari-find-file-in-project
C-c ; f h,rinari-find-helper
C-c ; f i,rinari-find-migration
C-c ; f j,rinari-find-javascript
C-c ; f l,rinari-find-plugin
C-c ; f m,rinari-find-model
C-c ; f n,rinari-find-configuration
C-c ; f o,rinari-find-log
C-c ; f p,rinari-find-public
C-c ; f s,rinari-find-script
C-c ; f t,rinari-find-test
C-c ; f v,rinari-find-view
C-c ; f w,rinari-find-worker
C-c ; f x,rinari-find-fixture
C-c ; f y,rinari-find-stylesheet

Git Stuff

git status==> see status files
git add init.el==> add init.el to commit change log
git commit==> commit changes
git remote add origingit remote add git@github.com:underhilllabs/[..].git
git push origin master==> push committed changes to git repository


Textile is a markup language. I use org-mode markup more these days.

!>bossy.jpg!here is a picture of Bossy that will use align=right
bq.a block quote
<pre><code>for long code blocks use html tags

wl Keybindings

Wanderlist is an Emacs Mode for Reading Email.

a or Areplay to email under point
dmark email for deletion
xexecute commands