-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
485 lines (471 loc) · 23.4 KB
/
index.html
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vim Tutorial</title>
<link rel="shortcut icon" href="favicon/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="bootstrap-5.1.3-dist/css/bootstrap.min.css">
</head>
<body class="bg-dark">
<div class="container">
<h1 class="text-light text-center">Vim Cheatsheet</h1>
<!--Lesson 1-->
<h2 class="text-light text-center">Lesson 1</h2>
<table class="table table-danger table-bordered border-dark table-hover">
<thead>
<tr>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> h</td>
<td>Move Left.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> l</td>
<td>Move Right.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> j</td>
<td>Move Down.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> k</td>
<td>Move Up.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :q</td>
<td>Close file.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :q!</td>
<td>Close file without saving.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :w</td>
<td>Write.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :wq</td>
<td>Write and quit.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> x</td>
<td>Delete Character at the Cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> i</td>
<td>Insert at cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> I</td>
<td>Insert at beginning.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> a</td>
<td>Append at cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> A</td>
<td>Append at end of line.</td>
</tr>
</tbody>
</table>
<!--Lesson 2-->
<h2 class="text-light text-center">Lesson 2</h2>
<table class="table table-danger table-bordered border-dark table-hover">
<thead>
<tr>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> dw</td>
<td>Delete word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> $</td>
<td>Go to the end of the text.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> w</td>
<td>Next Word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> b</td>
<td>Previous Word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> e</td>
<td>Go the end of the word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> 0</td>
<td>Go to beginning of the line at the very start.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> ^</td>
<td>Go to beginning of the line at the starting text.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> d$</td>
<td>Delete to the end of line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> 2w</td>
<td>Go two words forward.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> 3e</td>
<td>Go to the end of 3rd word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> d2w</td>
<td>Delete two words.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> dd</td>
<td>Delete entire line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> 2dd</td>
<td>Delete two entire line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> u</td>
<td>Undo last change.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> U</td>
<td>Undo changes on entire line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> Cntrl + r</td>
<td>Redo changes.</td>
</tr>
</tbody>
</table>
<!--Lesson 3-->
<h2 class="text-light text-center">Lesson 3</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<tr>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> p</td>
<td>Paste after Cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> P</td>
<td>Paste before Cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> cw</td>
<td>Change word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> r</td>
<td>Replace character under the cursor.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> c$</td>
<td>Change to the end of line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> c2w</td>
<td>Change 2 words.</td>
</tr>
</tbody>
</table>
<table>
<!--Lesson 4-->
<h2 class="text-light text-center">Lesson 4</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<tr>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :50</td>
<td>Go to line no 50.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> G</td>
<td>Go to the last line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> gg</td>
<td>Go to the first line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> /waldo</td>
<td>Search for waldo.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> n</td>
<td>Go to next search result.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> N</td>
<td>Go to previous search result.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> ?carman</td>
<td>Search carman in reversed.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> ctrl + o</td>
<td>Jump to previous location.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> ctrl + i</td>
<td>Jump to next location.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> %</td>
<td>Go to next matching pranthesis or brackets.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :%s/bad/good</td>
<td>Replace bad with good in current line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :%s/hi/bye/g</td>
<td>Replace hi with bye in whole document globally.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :%s/x/y/gc</td>
<td>Replace x with y and ask for confirmations.</td>
</tr>
</table>
<!--Lesson 5-->
<h2 class="text-light text-center">Lesson 5</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> v</td>
<td>Open visual mode.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> V</td>
<td>Open visual select lines.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> vw</td>
<td>Visual select word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> vwx or vwd</td>
<td>Visual select and then delete the word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :w readme.txt</td>
<td>To write the current data as readme.txt.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :!ls</td>
<td>Run ls shell command.</td>
</tr>
</tbody>
</table>
<!--Lesson 6-->
<h2 class="text-light text-center">Lesson 6</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> o</td>
<td>Open new line below.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> O</td>
<td>Open new line above.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> e</td>
<td>Go to the end of the word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> 2e</td>
<td>Go to the end of two words.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> R</td>
<td>Enter replace mode.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> yw</td>
<td>Yank Word.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> vwy</td>
<td>Visual select word then yank.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> y$</td>
<td>Yank to the end of the Current Line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :set ignorecase</td>
<td>Change the search settings to ignore case.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :set noignorecase</td>
<td>Change the search settings to use case.</td>
</tr>
</tbody>
</table>
<!-- Important Functions -->
<h2 class="text-light text-center">Recording Macro Function</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function </th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> q</td>
<td>To start recording macro.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> Any key between (a - z)</td>
<td>This will assign the key on which the macro is recorded.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> q</td>
<td>Press q again to stop recording macro.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> @ + the key between (a-z) the macro was recorded on</td>
<td>This will run the macro.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> @ + @</td>
<td>After running the macro you can use this to repeat the macro.</td>
</tr>
</tbody>
</table>
<!--Some important settings and shortcuts-->
<h2 class="text-light text-center">Some important settings and shortcuts.</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :set number</td>
<td>Shows the line number</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :set relativenumber</td>
<td>Shows the number of lines above and below makes it easy and quick to navigate.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> yy</td>
<td>To copy whole line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> cc</td>
<td>To change whole line.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> * and #</td>
<td>To find other instances of the same word or character.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> zz</td>
<td>To center the view page.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> .</td>
<td>To repeat the recent action.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> t</td>
<td>To transfer cursor before the stated character. For example t* will transfer the cursor to a place just before * in the code.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> f</td>
<td>Will find and transfer the cursor to the stated character. For exapmle f* will put the cursor on * looking forward in the code.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> T</td>
<td>Will perform similar function as t but in reversed order.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> F</td>
<td>Will perform similar function as f but in reversed order.</td>
</tr>
</tbody>
</table>
<!--Understanding Registry for copy and Pasting stuffs-->
<h2 class="text-light text-center">Understanding Registry for copy and pasting stuffs.</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> :register</td>
<td>Shows the register where the history of yanking and cutting is stored.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> "(a-z)y</td>
<td>This will help to create a custom register to the assigned key between or the selected text can be yanked to any key from a-z.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> "(a-z)p</td>
<td>This will paste custom register created.</td>
</tr>
</tbody>
</table>
<!--Use of i or in-->
<h2 class="text-light text-center">Use of i or in</h2>
<table class="table table-danger table-hover table-bordered border-dark">
<thead>
<th class="text-light" style="background-color: #DC3545">Key</th>
<th class="text-light" style="background-color: #DC3545">Function</th>
</thead>
<tbody>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> ci( or di( or ci{ or di[</td>
<td>ci( will change the text within (). di( will delete the text within (). This will be the same with any of the stated brackets.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> yiw</td>
<td>This will copy the word between which the cursor is.</td>
</tr>
<tr>
<td><input class="form-check-input" type="checkbox" name="" id=""> diw</td>
<td>This will delete the word between which the cursor is.</td>
</tr>
</tbody>
</table>
</div>
<script src="script.js"></script>
<script src="bootstrap-5.1.3-dist/js/bootstrap.min.js"></script>
</body>
</html>