-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathsample_config.json5
111 lines (111 loc) · 4.49 KB
/
sample_config.json5
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
// This is a JSON5 file, so you can use comments and trailing commas, which
// makes it a lot more convenient for configs.
// diffsitter looks for config files in
// ${XDG_HOME:-$HOME}/.config/diffsitter/config.json5 by default. You can
// override this behavior by passing the `--config` flag or setting the
// "DIFFSITTER_CONFIG" environment variable.
{
// Set options for terminal formatting here
"formatting": {
"unified": {
// Set the style for diff hunks from the new document
"addition": {
// The color of the highlight around emphasized added text
"highlight": null,
// The foreground color for regular text
"regular-foreground": "green",
// The foreground color for emphasized text
// Note that colors can either be a string or a 256 bit color value
"emphasized-foreground": {
"color256": 0,
},
// Whether emphasized text should be bolded
"bold": true,
// Whether emphasized text should be underlined
"underline": false,
// The prefix string prepend to the contents of the diff hunk, for
// an addition hunk
"prefix": "+",
},
// Set the style for diff hunks from the old document
// These are the same as the options for "addition", the only
// difference is that they apply to the deletion hunks
"deletion": {
"regular-foreground": "red",
"emphasized-foreground": "red",
"bold": true,
"underline": false,
"prefix": "-",
},
},
// We can also define custom render modes which are defined as a
// key-value mapping of tags to rendering configs.
"custom": {
"custom_render_mode": {
"type": "unified",
// Set the style for diff hunks from the new document
"addition": {
// The color of the highlight around emphasized added text
"highlight": null,
// The foreground color for regular text
"regular-foreground": "green",
// The foreground color for emphasized text
// Note that colors can either be a string or a 256 bit color value
"emphasized-foreground": {
"color256": 0,
},
// Whether emphasized text should be bolded
"bold": true,
// Whether emphasized text should be underlined
"underline": false,
// The prefix string prepend to the contents of the diff hunk, for
// an addition hunk
"prefix": "+",
},
// Set the style for diff hunks from the old document
// These are the same as the options for "addition", the only
// difference is that they apply to the deletion hunks
"deletion": {
"regular-foreground": "red",
"emphasized-foreground": "red",
"bold": true,
"underline": false,
"prefix": "-",
},
},
},
},
// Set options related to grammars here
"grammar": {
// You can set different file associations here, these will be merged with
// the default associations, where the associations in the config take
// precedence
"file-associations": {
"rs": "rust",
},
// You can specify the dynamic library names for each language
"dylib-overrides": {
// with a filename
"rust": "libtree-sitter-rust.so",
// with an absolute path
"c": "/usr/lib/libtree-sitter-c.so",
// with a relative path
"cpp": "../libtree-sitter-cpp.so",
},
},
// Specify a fallback command if diffsitter can't parse the given input
// files. This is invoked by diffsitter as:
//
// ```sh
// ${fallback_cmd} ${old} ${new}
// ```
"fallback-cmd": "diff",
"input-processing": {
"split-graphemes": true,
// You can exclude different tree sitter node types - this rule takes precedence over `include_kinds`.
"exclude-kinds": ["string"],
// You can specifically allow only certain tree sitter node types
"include-kinds": ["method_definition"],
"strip-whitespace": true,
}
}