-
Notifications
You must be signed in to change notification settings - Fork 6
/
paredit-cheatsheet-refcard.tex
344 lines (281 loc) · 6.51 KB
/
paredit-cheatsheet-refcard.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
\documentclass[8pt,a4paper,landscape]{extarticle}
\usepackage[cm]{fullpage}
\usepackage{microtype}
\usepackage[top=1cm,bottom=1.5cm,left=2cm,right=2cm]{geometry}
\usepackage{multicol}
\usepackage{eqlist}
\usepackage[pdftex]{hyperref}
\usepackage{nopageno}
\usepackage[usenames]{xcolor}
\newcommand{\doctitle}{Paredit Cheatsheet}
\newcommand{\docauthor}{Taylor R. Campbell}
\setcounter{secnumdepth}{-1}
\hypersetup{
pdfauthor={\docauthor},
pdftitle={\doctitle},
pdfstartview={FitH}
}
\linespread{0.5}
\font\btt=rm-lmtk10
\newcommand{\csr}{\textcolor{red}{| }}
\begin{document}
\hspace*{\fill}{\huge \bfseries \doctitle \hspace*{\fill}}
\vspace{2em}
\begin{multicols}{4}
\section{Basic Insertion Commands}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[(] paredit-open-round\\
\\
(a b \csr c d)\\
(a b (\csr ) c d)\\
\\
(foo "bar \csr baz" quux)\\
(foo "bar (\csr baz" quux)\\
\item[)] paredit-close-round\\
\\
(a b \csr c )\\
(a b c)\csr \\
\\
; Hello,\csr world!\\
; Hello,)\csr world!\\
\item[M-)] paredit-close-round-and-newline\\
\\
(defun f (x\csr ))\\
(defun f (x)\\
\csr )\\
\\
; (Foo.\csr \\
; (Foo.)\csr \\
\item[\lbrack] paredit-open-square\\
\\
(a b \csr c d)\\
(a b \lbrack \csr \rbrack c d)\\
\\
(foo "bar \csr baz" quux)\\
(foo "bar \lbrack baz" quux)\\
\item[\rbrack] paredit-close-square\\
\\
(define-key keymap \lbrack frob\csr \rbrack 'frobnicate)\\
(define-key keymap \lbrack frob\rbrack \csr 'frobnicate)\\
\\
; \lbrack Bar.\csr \\
; \lbrack Bar.\rbrack \csr \\
\item["] paredit-doublequote\\
\\
(frob grovel \csr full lexical)\\
(frob grovel "\csr " full lexical)\\
\\
(foo "bar \csr baz" quux)\\
(foo "bar "\csr baz" quux)\\
\item[M-"] paredit-meta-doublequote\\
\\
(foo "bar \csr baz" quux)\\
(foo "bar baz"\\
\csr quux)\\
\\
(foo \csr (bar \#\textbackslash x "baz \textbackslash\textbackslash~quux")
zot)\\
(foo "\csr (bar \#\textbackslash\textbackslash x \textbackslash "baz
\textbackslash\textbackslash\textbackslash\textbackslash~quux\textbackslash
")" zot)\\
\item[\textbackslash] paredit-backslash\\
\\
(string \#\csr )\\
; Escaping character... (x)\\
(string \#\textbackslash x\csr )\\
\\
"foo\csr bar"\\
; Escaping character... (")\\
"foo\textbackslash "\csr bar"\\
\item[M-;] paredit-comment-dwim\\
\\
(foo \csr bar)~~~; baz\\
(foo bar)~~~~~; \csr baz\\
\\
(frob grovel)\csr \\
(frob grovel)~; \csr \\
\\
\csr (defun hello-world ...)\\
;;; \csr \\
(defun hello-world ...)\\
\item[C-j] paredit-newline\\
\\
(let ((n (frobbotz))) \csr (display (+ n 1)\\
port))\\
(let ((n (frobbotz)))\\
\csr (display (+ n 1)\\
port))\\
\end{eqlist}
\section{Deleting and Killing}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[C-d] paredit-forward-delete\\
\\
(quu\csr x "zot")\\
(quu\csr "zot")\\
\\
(quux \csr "zot")\\
(quux "\csr zot")\\
(quux "\csr ot")\\
\\
(foo (\csr ) bar)\\
(foo \csr bar)\\
\\
\csr (foo bar)\\
(\csr foo bar)\\
\item[DEL] paredit-backward-delete\\
\\
("zot" q\csr uux)\\
("zot" \csr uux)\\
\\
("zot"\csr quux)\\
("zot\csr " quux)\\
("zo\csr " quux)\\
\\
(foo (\csr ) bar)\\
(foo \csr bar)\\
\\
(foo bar)\csr \\
(foo bar\csr )\\
\item[C-k] paredit-kill\\
\\
(foo bar)\csr ; Useless comment!\\
(foo bar)\csr \\
\\
(\csr foo bar) ; Useful comment!\\
(\csr ) ; Useful comment!\\
\\
\csr (foo bar) ; Useless line!\\
\csr \\
\\
(foo "\csr bar baz"\\
quux)\\
(foo "\csr "\\
quux)\\
\columnbreak
\item[M-d] paredit-forward-kill-word\\
\\
\csr (foo bar) ; baz\\
(\csr bar) ; baz\\
(\csr ) ; baz\\
() ;\csr \\
\\
;;;\csr Frobnicate\\
(defun frobnicate ...)\\
;;;\csr \\
(defun frobnicate ...)\\
;;;\\
(\csr frobnicate ...)\\
\longitem[M-DEL] paredit-backward-kill-word\\
\\
(foo bar) ; baz\\
(quux)\csr \\
(foo bar) ; baz\\
(\csr )\\
(foo bar) ; \csr \\
()\\
(foo \csr ) ; \\
()\\
(\csr ) ; \\
()\\
\end{eqlist}
\section{Movement and Navigation}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[C-M-f] paredit-forward\\
\\
(foo \csr (bar baz) quux)\\
(foo (bar baz)\csr quux)\\
\\
(foo (bar)\csr )\\
(foo (bar))\csr \\
\item[C-M-b] paredit-backward\\
\\
(foo (bar baz)\csr quux)\\
(foo \csr (bar baz) quux)\\
\\
(\csr (foo) bar)\\
\csr ((foo) bar)\\
\item[C-M-u] paredit-backward-up
\item[C-M-d] paredit-forward-down
\item[C-M-p] paredit-backward-down
\item[C-M-n] paredit-forward-up
\end{eqlist}
\section{Depth Changing}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[M-(] paredit-wrap-round\\
\\
(foo \csr bar baz)\\
(foo (\csr bar) baz)\\
\item[M-s] paredit-splice-sexp\\
\\
(foo (bar\csr baz) quux)\\
(foo bar\csr baz quux)\\
\item[M-$\uparrow$] paredit-splice-sexp-killing-backward\\
\\
(foo (let ((x 5)) \csr (sqrt n)) bar)\\
(foo (sqrt n) bar)\\
\item[M-$\downarrow$] paredit-splice-sexp-killing-forward\\
\\
(a (b c\csr d e) f)\\
(a b c f)\\
\item[M-r] paredit-raise-sexp\\
\\
(dynamic-wind in (lambda () \csr body) out)\\
(dynamic-wind in \csr body out)\\
\csr body\\
\end{eqlist}
\section{Barfage and Slurpage}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[C-)] paredit-forward-slurp-sexp\\
\\
(foo (bar \csr baz) quux zot)\\
(foo (bar \csr baz quux) zot)\\
\\
(a b ((c\csr d)) e f)\\
(a b ((c\csr d) e) f)\\
\item[C-\}] paredit-forward-barf-sexp\\
\\
(foo (bar \csr baz quux) zot)\\
(foo (bar \csr baz) quux zot)\\
\longitem[C-(] paredit-backward-slurp-sexp\\
\\
(foo bar (baz\csr quux) zot)\\
(foo (bar baz\csr quux) zot)\\
\\
(a b ((c\csr d)) e f)\\
(a (b (c\csr d)) e f)\\
\longitem[C-\{] paredit-backward-barf-sexp\\
\\
(foo (bar baz \csr quux) zot)\\
(foo bar (baz \csr quux) zot)\\
\end{eqlist}
\section{Miscellaneous}
\begin{eqlist}[\eqliststarinit\def\makelabel#1{\btt#1}\labelsep1em]
\tt
\item[M-S] paredit-split-sexp\\
\\
(hello\csr world)\\
(hello)\csr (world)\\
\\
"Hello, \csr world!"\\
"Hello, "\csr "world!"\\
\item[M-J] paredit-join-sexps\\
\\
(hello)\csr (world)\\
(hello\csr world)\\
\\
"Hello, "\csr "world!"\\
"Hello, \csr world!"\\
\\
hello-\\
\csr world\\
hello-\csr world\\
\longitem[C-c C-M-l] paredit-recentre-on-sexp
\item[M-q] paredit-reindent-defun
\end{eqlist}
\end{multicols}
\end{document}