-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcorrections.js
84 lines (69 loc) · 1.53 KB
/
corrections.js
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
/**
* src/corrections.js
*/
module.exports = {
/**
* 01. About the manuals
*/
usr_01: {
// Turn formatted block into unordered list
'40-41': line => line.replace('\t', '- '),
// Remove indent and add missing full stop at the end of the line
168: line => line.trim() + '.',
},
/**
* 02. The first steps in Vim
*/
usr_02: {
// Add missing full stop at the end of the line
695: line => line + '.',
},
/**
* 04. Making small changes
*/
usr_04: {
// Add missing 's'
467: line => line.replace('correction', 'corrections'),
},
/**
* 05. Set your settings
*/
usr_05: {
// Surround @@@ with double quotes
236: line => line.replace('@@@', '"@@@"'),
// Replace the mixed indentation by two tabs
412: line => line.replace('\t \t', '\t\t'),
// Turn formatted block into unordered list
'432-433': line => line.replace(/^ +/, '- '),
},
/**
* 10. Making big changes
*/
usr_10: {
// Add missing ending double-quote
447: line => line.replace('"$A XXX<Esc>', '"$A XXX<Esc>"'),
},
/**
* 21. Go away and come back
*/
usr_21: {
// Turn formatted block into unordered list
'96-100': line => line.replace('\t', '- '),
},
/**
* 24. Inserting quickly
*/
usr_24: {
// Remove indentation before digraph table
'552-554': line => line.replace(/^\s+/, ''),
// Fix column alignment
554: line => line.replace('--', '-- '),
},
/**
* 29. Moving through programs
*/
usr_29: {
// Add double quotes around comment delimiters
428: line => line.replace('/* - */', '"/* - */"'),
},
};