]> code.delx.au - dotemacs/blob - README.md
bac8463b659efe9b7b22a696d11654695099edfd
[dotemacs] / README.md
1 # References
2 * [Reference Card](https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf)
3 * [Key Binding Conventions](https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html)
4
5 # General commands
6 ```
7 C-x C-c Quit Emacs
8 C-u C-x C-c Save and quit
9 C-g Cancel command
10 C-/ Undo
11 C-g C-/ Undo undo
12 C-x z Repeat last command
13 M-x Execute command
14 M-: Evaluate expression as elisp
15 M-x eval-buffer Load current buffer as elisp
16 C-x C-0 Reset font to standard
17 C-x C-+/= Increase font size
18 C-x C-- Decrease font size
19 ```
20
21 # Help
22 ```
23 C-h C-h Help
24 C-h k Help about key binding
25 C-h v Describe variable
26 C-h f Describe function
27 C-h m Documentation on active modes
28 ```
29
30 # Search
31 ```
32 C-s Search forward (ivy/swiper mode)
33 C-r Resume ivy search
34 M-s . Search for symbol around point
35 C-s Find next item (while searching)
36 Backspace Previous search (while searching)
37 M-% Search and replace
38 M-x linum-mode Display line numbers
39 ```
40
41 # Files/buffers
42 ```
43 C-x C-s Save current buffer
44 C-x s Save some buffers
45 C-x C-w Write buffer to file
46 C-x C-f Find file
47 C-x f Find files in git repository
48 C-x g Grep in git repository
49 M-x find-file-at-point Find (open) filename at point
50 M-x browse-url-at-point Browse URL at point
51 C-x k Kill buffer
52 C-x c Clean up all buffers that are not visible
53 C-x b Select named buffer
54 C-x C-b Show all buffers
55 C-x C-r Show recent files
56 M-x scratch-buffer Create new scratch buffer
57 ```
58
59 # Windows/frames
60 ```
61 C-x o Switch to other window
62 C-x 0 Delete window
63 C-x 1 Switch to single window
64 C-x 2 Split vertically
65 C-x 3 Split horizontally
66 C-x - Shrink window
67 C-x + Make windows the same height
68 C-x ^ Make window taller
69 C-Up / C-Down / C-Left / C-Right Switch windows
70 M-x make-frame New frame (X11 window)
71 ```
72
73 # Movement
74 ```
75 M-m Jump back to start of indentation
76 M-r Jump to window top/bottom/middle
77 M-g M-g Jump to line
78 M-g Tab Jump to column
79 M-g j Jump to character
80 C-a Beginning of line
81 C-e End of line
82 C-p Back one line
83 C-n Forward one line
84 C-b Back one character
85 C-n Forward one character
86 M-b Back a word
87 M-f Forward a word
88 M-a Backward sentence
89 M-e Forward sentence
90 M-v Back page
91 C-v Forward page
92 M-{ Back one paragraph
93 M-} Forward one paragraph
94 M-< Top of file
95 M-> End of file
96 C-M-p Back to start of balanced expression
97 C-M-n Forward to end of balanced expression
98 C-M-b Back one s-expression / symbol
99 C-M-f Forward one s-expression / symbol
100 C-M-u Move up one level of parentheses
101 ```
102
103 # Text formatting
104 ```
105 M-/ Auto-complete
106 M-; Comment line or region
107 M-i Change inner region
108 M-q Reformat paragraph
109 M-l Lower case word
110 M-u Upper case word
111 M-c Capitalise word
112 C-x C-l Lower case region
113 C-x C-u Upper case region
114 C-o Insert a new line above point
115 M-o Insert a new line below point
116 C-j Newline and maybe indent
117 M-^ Join to previous line
118 M-j New line with comment
119 C-q Quoted insert
120 ```
121
122 # Marking
123 ```
124 C-Space Set mark (start selection)
125 C-Space C-Space Set mark to point
126 C-u C-space Return to mark
127 C-x C-x Exchange point and mark
128 C-M-h Highlight expression
129 M-@ Set mark at end of next word
130 C-= Expand region
131 C-c l Insert extra cursor on all lines in region
132 C-c m Ask to insert extra cursor at locations matching selected region
133 M-= Display info about region
134 ```
135
136 # Killing and deleting
137 ```
138 C-M-k Kill s-expression / symbol
139 C-w Kill from mark to point
140 C-y Yank text (paste)
141 M-y Scroll through kill ring (paste buffer)
142 M-_ Select current line
143 M-z <char> Kill until <char>
144 C-k Kill to end of line
145 M-0 C-k Kill to beginning of line
146 C-a C-k C-k Kill current line
147 C-S-Backspace Kill current line
148 C-d Delete next character
149 M-d Delete next word
150 M-Backspace Delete previous word
151 M-Space Collpase to one space around point
152 M-\ Delete spaces around point
153 C-x C-o Collapse blank lines
154 M-x delete-trailing-whitespace Delete trailing whitespace
155 ```
156
157 # Transposing
158 ```
159 C-t Transpose chars
160 M-t Transpose words
161 C-x C-t Transpose lines
162 C-M-t Transpose s-expressions
163 ```
164
165 # Rectangle
166 ```
167 C-x Space Toggle mark rectangle mode
168 C-x r t Replace rectangle with string
169 ```
170
171 # Macros
172 ```
173 F3 , F4 Start recording macro, finish recording macro
174 C-u F3 Play last macro then append keys
175 F4 Play back macro
176 ```
177
178 # Mode switching
179 ```
180 C-x C-j Open direx at current file
181 F8 Toggle flyspell-mode
182 F9 Toggle whitespace mode
183 F10 Toggle word wrap
184 M-x eshell Run eshell
185 M-x ielm Run Emacs Lisp REPL
186 M-x shell Run bash shell
187 M-x slime Run Common Lisp REPL
188 M-x smerge-ediff Resolve merge conflicts in multi-window mode
189 M-x smerge-mode Resolve merge conflicts by hunks
190 M-x restclient Open HTTP client
191 M-x yas-reload-all Reload all snippets
192 ```
193
194 # Lisp
195 ```
196 C-M-x Eval top-level form
197 C-c C-z Switch to REPL
198 C-c C-c Compile and load the top-level form at point
199 C-c M-k Compile (but not load) the current buffer's file
200 ```
201
202 # Shell
203 ```
204 M-! Execute command
205 M-& Execute command asynchronously
206 M-| Execute with region
207 C-u M-| Filter with region
208 ```
209
210 # Smerge mode
211 ```
212 C-c ^ p Go to previous hunk
213 C-c ^ n Go to next hunk
214 C-c ^ Return Keep current
215 C-c ^ a Keep all
216 C-c ^ m Keep mine
217 C-c ^ o Keep other
218 ```
219
220 # Flyspell
221 ```
222 M-$ Correct word
223 C-M-i Automatically correct word
224 C-; Automatically correct last word
225 <mouse-2> Popup word correction
226 ```
227
228 # Flycheck
229 ```
230 C-c ! v Verify setup
231 C-c ! n Next error
232 C-c ! p Previous error
233 C-c ! l List errors
234 C-c ! x Disable checker
235 ```