-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs-keys.txt
195 lines (155 loc) · 4.55 KB
/
emacs-keys.txt
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
M-w - kill-ring-save basically copy
C-k - kill, basically cut
C-y - yank, basically paste
DEL - delete without yanking
After C-y, can do M-y to cycle through previous yanks.
Rectangles
C-x r c - clear region replace with spaces
C-x r k kill region rect
C-x r t - replace text
M-x string-insert-rectangle
C-x <SPC> toggle rect mode
(require 'multiple-cursors)
(global-set-key (kbd "C-c d") 'mc/mark-next-like-this)
(global-set-key (kbd "C-c p") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c a") 'mc/mark-all-like-this)
fiplr reload, while searching: C-c r
upcase - M-u (region C-x C-u)
lowercase - M-l (region C-x C-l)
capitalize - M-c
Dired mode
C-x d dired mode,
o - open in another window (can be a dir or file)
i - write directory contains in same file
^ - go up a directory (like ..)
+ - create directory
( - toggle file details from `ls`
q - exit
n,p - next previous
<,> - navigate between directory lines only
j - goto file
$ - toggle directory block (useful when pressing i) M-$ hides all
m - mark
k - remove from buffer (line not file)
s - sort, alternate by alpha and date/time
flycheck
C-c ! l - see full list of errors in a buffer. Details
C-c ! n - next error
C-c ! p - previous error
regexp search and replace
replace-regexp "\(\w+\)": RET \1:
LESS commands
[space], [b] forward and back 1 page
[j], [k], forward and back 1 line
g, G beginning and end of file
= file info
/ search n, N next, previous search, ? serach backward
/^diff goes to next file in git diff
Emacs keyboard shortcuts
C-h m - help for current mode
AG:
r wgrep-mode
C-x C-s save changes
C-x C-q exit wgrep
C-c C-f next-error-follow-minor-mode
n/p nav
q close, k kill
M-t transpose lines
C-M-a or e forward back defun
C-M-h select current defun
M-k kill sentence
web-mode
C-c C-f code folding
C-c C-o toggle folding 1 element
C-c C-n up down open/close tag
# Put a .emacs file in your project root directory
M-SPC - start mark
C-x DEL - kill to beginning of line
C-k - kill to end of line
M-(number) - Change to window number shown in red. This is window-number-meta-mode
C-c C-j - terminal char mode (like editor)
C-c C-k - terminal line mode (like command line) - K for Kommand Line
Ruby Next Block C-M-n
Ruby Previous Block C-M-p
Cx-x v = (vc-diff or git diff)
Toggle Tail Mode - scroll to end and press M-T
Find file in project - M-n
Find in Project - M-p
Indent block - tab
Comment block - M-;
RSPEC
Got to test file C-c, t
Run test file C-c, v
Find in Project M-n
Run 1 test C-c, s
Run full suite C-c, a
FILE
Open Ctrl-X, Ctrl-F
Save Ctrl-X, Ctrl-S
Save As Ctrl-X, Ctrl-W
Save All Ctrl-X, S
Revert to File Ctrl-X, Ctrl-V
Revert Buffer Meta-X, revert-buffer
Close Window/Buffer Ctrl-X, K
Quit Ctrl-X, Ctrl-C
EDIT
Undo Ctrl-_
Begin Selection Ctrl-SPC
Cancel Selection Ctrl-G
Cut Selection Ctrl-W
Copy Selection M-w
Cut Line Ctrl-K
Paste Ctrl-Y
Copy Selection to Numbered Clipboard Ctrl-X R S [#]
Paste from Numbered Clipboard Ctrl-X R I [#]
Delete DEL
Fwd Delete Ctrl-D
Delete Word Meta-DEL
Fwd Delete Word Meta-D
Delete Line Ctrl-K
CURSOR MOVEMENT
FORWARD BACKWARD
character left right C-f C-b
line up down C-n C-p
Word Meta-F Meta-B
Line Ctrl-A Ctrl-E
Paragraph Meta-{ Meta-}
Page Ctrl-V Meta-V
Document Meta-< Meta->
C Function Meta-Ctrl-A Meta-Control-E
SEARCH
Incremental Search Ctrl-S
Incremental Search Reverse Ctrl-R
Regexp Inc Search Meta-Ctrl-S
Regexp Inc Search Reverse Meta-Ctrl-R
Interactive Search and Replace Meta-%
Goto Line Number Meta-X goto-line
Previous Matching Bracket Meta-Ctrl-B (or ESC Ctrl-B)
Next Matching Bracket Meta-Ctrl-F (or ESC Ctrl-F)
WINDOW
Close Ctrl-X, K
Next Window Ctrl-X, B
Choose Window Ctrl-X, Ctrl-B
Maximize Ctrl-X, 1
Split Horizontal Ctrl-X, 2
Split Vertical Ctrl-X, 3
Equally Size All Windows Ctrl-X, +
Switch Focus Between Windows Ctrl-X, O
Activate Menu Bar Meta-`
REGISTERS
Copy Selection to Numbered Clipboard Ctrl-X R S [#]
Paste from Numbered Clipboard Ctrl-X R I [#]
Set Numbered Bookmark Ctrl-X R SPC [#]
Jump to Numbered Bookmark Ctrl-X R J [#]
FORMATTING
Re-flow Paragraph Meta-Q
Indent Selection Meta-Control-\
Uppercase Word Meta-U
Lowercase Word Meta-L
Capitalize Word Meta-C
Uppercase Selection Ctrl-X, Ctrl-U
Lowercase Selection Ctrl-X, Ctrl-L
MACROS
Start Recording Ctrl-X, (
Stop Recording Ctrl-X, )
Play Macro Ctrl-X, E