]> code.delx.au - dotemacs/blob - README.md
exclude some things from recentf
[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 C-7 Start a cursor for each result (while searching)
35 M-q Replace searched item (while searching)
36 M-p Search for previous item (while searching)
37 M-n Search for symbol at point (while searching)
38 M-% Search and replace
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 Tab Jump to column
78 M-g M-j Jump to charactor
79 M-g M-w Jump to word by first character
80 M-g M-g Jump to visible line or any line
81 C-a Beginning of line
82 C-e End of line
83 C-p Back one line
84 C-n Forward one line
85 C-b Back one character
86 C-n Forward one character
87 M-b Back a word
88 M-f Forward a word
89 M-a Backward sentence
90 M-e Forward sentence
91 M-v Back page
92 C-v Forward page
93 M-{ Back one paragraph
94 M-} Forward one paragraph
95 M-< Top of file
96 M-> End of file
97 C-M-p Back to start of balanced expression
98 C-M-n Forward to end of balanced expression
99 C-M-b Back one s-expression / symbol
100 C-M-f Forward one s-expression / symbol
101 C-M-u Move up one level of parentheses
102 ```
103
104 # Text formatting
105 ```
106 M-/ Auto-complete
107 M-; Comment line or region
108 M-i Change inner region
109 M-q Reformat paragraph
110 M-l Lower case word
111 M-u Upper case word
112 M-c Capitalise word
113 C-x C-l Lower case region
114 C-x C-u Upper case region
115 C-o Insert a new line above point
116 M-o Insert a new line below point
117 C-j Newline and maybe indent
118 M-^ Join to previous line
119 M-j New line with comment
120 C-q Quoted insert
121 M-x comment-box Wrap region in comment box
122 ```
123
124 # Marking
125 ```
126 C-Space Set mark (start selection)
127 C-Space C-Space Set mark to point
128 C-u C-space Return to mark
129 C-x C-x Exchange point and mark
130 C-M-h Highlight expression
131 M-@ Set mark at end of next word
132 C-= Expand region
133 C-c l Insert extra cursor on all lines in region
134 C-c m Ask to insert extra cursor at locations matching selected region
135 M-= Display info about region
136 ```
137
138 # Killing and deleting
139 ```
140 C-M-k Kill s-expression / symbol
141 C-w Kill from mark to point
142 C-y Yank text (paste)
143 M-y Scroll through kill ring (paste buffer)
144 M-_ Select current line
145 M-z <char> Kill until <char>
146 C-k Kill to end of line
147 M-0 C-k Kill to beginning of line
148 C-a C-k C-k Kill current line
149 C-S-Backspace Kill current line
150 C-d Delete next character
151 M-d Delete next word
152 M-Backspace Delete previous word
153 M-Space Collpase to one space around point
154 M-\ Delete spaces around point
155 C-x C-o Collapse blank lines
156 M-x delete-trailing-whitespace Delete trailing whitespace
157 ```
158
159 # Transposing
160 ```
161 C-t Transpose chars
162 M-t Transpose words
163 C-x C-t Transpose lines
164 C-M-t Transpose s-expressions
165 ```
166
167 # Rectangle
168 ```
169 C-x Space Toggle mark rectangle mode
170 C-x r t Replace rectangle with string
171 ```
172
173 # Macros
174 ```
175 F3 , F4 Start recording macro, finish recording macro
176 C-u F3 Play last macro then append keys
177 F4 Play back macro
178 ```
179
180 # Mode switching
181 ```
182 C-x C-j Open direx at current file
183 F8 Toggle flyspell-mode
184 F9 Toggle whitespace mode
185 F10 Toggle word wrap
186 M-x eshell Run eshell
187 M-x ielm Run Emacs Lisp REPL
188 M-x linum-mode Display line numbers
189 M-x shell Run bash shell
190 M-x slime Run Common Lisp REPL
191 M-x smerge-ediff Resolve merge conflicts in multi-window mode
192 M-x smerge-mode Resolve merge conflicts by hunks
193 M-x restclient Open HTTP client
194 M-x yas-reload-all Reload all snippets
195 ```
196
197 # Lisp
198 ```
199 C-M-x Eval top-level form
200 C-c C-z Switch to REPL
201 C-c C-c Compile and load the top-level form at point
202 C-c M-k Compile (but not load) the current buffer's file
203 ```
204
205 # Shell
206 ```
207 M-! Execute command
208 M-& Execute command asynchronously
209 M-| Execute with region
210 C-u M-| Filter with region
211 ```
212
213 # Smerge mode
214 ```
215 C-c ^ p Go to previous hunk
216 C-c ^ n Go to next hunk
217 C-c ^ Return Keep current
218 C-c ^ a Keep all
219 C-c ^ m Keep mine
220 C-c ^ o Keep other
221 ```
222
223 # Flyspell
224 ```
225 M-$ Correct word
226 C-M-i Automatically correct word
227 C-; Automatically correct last word
228 <mouse-2> Popup word correction
229 ```
230
231 # Flycheck
232 ```
233 C-c ! v Verify setup
234 C-c ! n Next error
235 C-c ! p Previous error
236 C-c ! l List errors
237 C-c ! x Disable checker
238 ```