Written by
Aaron Bell
on
on
Faster grokking of emacs commands with gifs
Here’s what I learned from Daniel Higginbotham (2015) from Ch.2 of Clojure for the Brave and True.
Table of Contents:
Prereqs
- AppData/Roaming/.emacs.d, not ~/.emacs.d when adding Higginbotham’s config files
- Shortcut shorthand!
C-x C-f differs from C-x f. C-x C-f (Open file) vs. C-x f (fill lines, whatever that means). To execute, hold control for both (C-[letter] C-[letter]) vs (C-[letter] [let go of control] [letter]). (Using On-Screen Keyboard to avoid installing a keylogger).
- M- means “alt”.
Basic
- yank (pasting with C-y),
- set and work with regions (including region-only regex, and regex-based region selection; all done using C-space),
- use the kill ring (ah, the clipboard),
- kill (kilobytes, by cutting with C-k, or copying with M-k or Alt-k),
Intermediate
- Moving the cursor after yanking (Ctrl + y-ing or “C-y” for short) removes the ability to cycle through the kill ring
- I can split windows (C-x [some number between 0 and 3 inclusive, usually])
- M-/ (Bash-tab-like text-expansion).
- Clojure commands:
-
start CIDER (
C-x "cider-jack-in" enter
at your Clojure code) -
C-c C-d C-d
(help with a symbol, like println or defn. Press q to leave.)
-
C-x C-e
(execute the command directly left of the pointer),
C-u C-x C-e
(print expression output into the script)
C-c C-k y
(compile)
C-c C-d C-a [text] enter
(apropos search; like C-c C-d C-d but for something not under your pointer. Press q to leave.)
C-c M-n M-n
(set the REPL to the current namespace),
- use
paredit-mode
(M-x "paredite-mode"
; here’s a high quality post on Paredit)
- Point to the very left of an object (have the rectangle on the left-most character) before alt-shift-9-ing it (`M-(` )
- `C- ->` to slurp
- `C-M- <-` to slurp backwards
- `C- <-` to "barf" (yuck)
- `C-M- ->` to backward barf
Advanced
I know the authors based emacs on elisp, but I don’t have practical knowledge of elisp yet.
Thank you, Mr. Higginbotham, for the knowledge.