-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemacsup.txt
More file actions
225 lines (202 loc) · 7.69 KB
/
emacsup.txt
File metadata and controls
225 lines (202 loc) · 7.69 KB
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
Cider
-----
C-c M-j cider-jack-in
C-c M-c connect to running nREPL
M-x cider-jack-in start nREPL and connect
C-u M-x cider-jack-in specify lein/boot project
M-x cider-connect connect to running nREPL
C-c C-q Quit nREPL connection
Cider-Evaluate
---------------
C-c C-e Evaluate preceeding form
C-c C-v C-q or
C-c C-v q Same as above but also taps the result
C-c C-v w Evaluate and replace with result
C-c M-e Evaluate and output result to REPL
C-c M-p Load the preceeding form in REPL buffer
C-c C-p Evaluate preceeding form and pretty-print in popup
C-c C-f Evaluate top-level form and pretty-print in buffer
C-c C-c or
C-M-x Evaluate top-level form and echo
C-c C-v v Evaluate the form around point
C-c C-v r Evaluate the region and echo
C-c C-k Load (eval) the current buffer
C-c C-l Load (eval) a Clojure file
C-c C-M-l Load (eval) all Clojure files below a directory
C-c C-v n Eval the ns form
C-c C-b Interrupt any pending evaluations
Cider-Debug
------------
C-u C-M-x Adds breakpoint and prepares to debug
Other option is to just add #break before a form
M-x Lists all the instrumented defs
C-c C-c Evaluate the form again to remove break-point
C-c M-t v Enables tracing for the specified function
C-c M-t n Toggle tracing on/off for entire namespace
- Debugger Shortcuts
n Next Step
i Step into a function
o Step out of the current s-exp
O Force step out of the current s-exp
h Skip all s-exp upto here
H Force step to here
c Continue without stopping
e Evaluate code in current context
p Inspect a value
l Inspect local variables
j Inject a value into running code
s Show the current stack
t Trace
q Quit execution
Cider-Files/References/Docs
-----------------------------
C-c C-x Reload all modified files on classpath
C-c C-d d or
C-c C-d C-d Display doc string
C-c C-d j or
C-c C-d C-j Display JavaDoc
C-c C-d r or
C-c C-d C-r Lookup symbol in Grimoire
C-c C-d w or
C-c C-d C-w Open Grimoire documentation in browser
C-c C-d a or
C-c C-d C-a Apropos search for functions/vars
C-c C-d f or
C-c C-d C-f Apropos search for documentation
C-c C-d e or
C-c C-d C-e Apropos search for documentation select
M-. Jump to definition of symbol
C-c M-. Jump to resource referenced by point
C-c C-. Jump to some namespace on classpath
M-, Return to pre-jump location
M-TAB Complete the symbol at point
C-h v Update CIDER configuration
Paredit
--------
http://danmidwood.com/content/2014/11/21/animated-paredit.html
M-( or M-" Wrap s-expressions
C-) Forward Slurp
C-} Forward Barf
C-( Backward Slurp
C-{ Backward Barf
File/Buffer/Window
-------------------
key combo resulting editor command
C-x C-f open a file
C-x C-s save buffer
C-x s save file (save-as)
C-x C-c quit
C-x 0 close current window (after splitting)
C-x 1 close any other windows
C-x 2 split window horizontally
C-x 3 split window vertically
C-x o move cursor to other window
C-x k RET close current file (“kill buffer”)
C-x b RET make window show other buffer
Select/Cut/Copy/Paste
----------------------
C-Space begin text selection
C-x Space begin vertical rectangle selection
M-h select current paragraph
C-g cancel
C-w cut
M-w copy
C-y paste
M-y paste next
Selections/Rectangles
----------------------
C-x r k Kill region-rectangle text, save last killed rectangle (kill-rectangle)
C-x r M-w Save region-rectangle text as last killed rectangle (copy-rectangle-as-kill)
C-x r d Delete the text of the region-rectangle (delete-rectangle)
C-x r y Yank last killed rectangle with upper left corner at point (yank-rectangle)
C-x r o Insert blank space to fill the space of the region-rectangle (open-rectangle)
This pushes the previous contents of the region-rectangle to the right
C-x r N Insert line no. along left edge of region-rectangle (rectangle-number-lines)
This pushes the previous contents of the region-rectangle to the right
C-x r c Clear the region-rectangle by replacing content with spaces (clear-rectangle)
C-x SPC Toggle Rectangle Mark mode (rectangle-mark-mode)
When this mode is active, the region-rectangle is highlighted and
can be shrunk/grown, and the standard kill and yank commands operate on it.
M-x delete-whitespace-rectangle Delete whitespace in each of the lines
C-x r t string RET Replace rectangle contents with string on each line (string-rectangle)
M-x string-insert-rectangle RET string RET Insert string on each line of the rectangle.
Search/Replace/Edit
--------------------
C-s incremental search (RET to stop)
C-r incremental search backward
C-M-s regex incremental search
C-M-r regex incremental search backward
M-% search/replace
M-x qrr regex search/replace
C-k kill line
C-d kill character
M-d kill word
M-delete kill word backwards
Format
------
M-q re-wrap (reflow, justify) paragraph
M-; comment/uncomment region
C-/ undo
M-/ complete word (like tab-complete)
Move around
------------
C-a move cursor to beginning of line
C-e move cursor to end of line
C-f move cursor forward
C-b move cursor back
M-f move cursor forward-by-word
M-b move cursor backward-by-word
C-n move cursor to next line
C-p move cursor to prev line
M-n scroll view down
M-p scroll view up
C-l scroll to middle and redraw screen
M-m move to first non-whitespace char
M-{ move cursor up-by-paragraph
M-} move cursor down-by-paragraph
C-v page down
M-v page up
M-< go to top of buffer
M-> go to end of buffer
M-g M-g n go to line number n
C-M-b move to the beginning of s-exp
C-M-<space> select s-exp
Markdown
--------
C-c C-c m markdown-command > *markdown-output* buffer
C-c C-c p markdown-command > temporary file > browser
C-c C-c e markdown-command > basename.html
C-c C-c v markdown-command > basename.html > browser
C-c C-c w markdown-command > kill ring
C-c C-c o markdown-open-command
C-c C-c l markdown-live-preview-mode > *eww* buffer
Help
----
C-h t tutorial (goes over the basics)
C-h b describe all current key bindings
C-h m describe the current mode
C-h a apropos - search the help for a term
C-h k describe key
- Update ~/.emacs
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize)
Themes
-------
Dracula Theme- https://draculatheme.com/emacs/
Solarized Emacs- https://github.com/bbatsov/solarized-emacs
Blackboard Theme- https://github.com/don9z/blackboard-theme
Zerodark Theme- https://github.com/NicolasPetton/zerodark-theme
Clues Theme- https://emacsthemes.com/themes/clues-theme.html
Tomorrow Night Paradise- https://github.com/jimeh/tomorrow-night-paradise-theme.el
Color Theme UJelly- https://github.com/marktran/color-theme-ujelly
Zenburn- https://github.com/bbatsov/zenburn-emacs
References
-----------
http://www.braveclojure.com/basic-emacs/
http://blog.aaronbieber.com/2015/05/24/from-vim-to-emacs-in-fourteen-days.html
http://www.unexpected-vortices.com/clojure/10-minute-emacs-for-clojure.html
Paredit: http://danmidwood.com/content/2014/11/21/animated-paredit.html