feat(garuda-common-settings): add syntax highlighting for configs in micro
Add syntax highlighting for config files opened in Micro that don't directly call a shell. * Add a syntax definition for `filetype: conf` in `syntax/conf.yaml` with some basic rules (for example, highlighting commented lines); * Define `/etc/*` and `/home/*/.config/*` as conf filetype in `settings.json`, because they contain a lot of config files that don't end in ".conf" or ".cfg".
This commit is contained in:
parent
2c9248f9d7
commit
93f0691b06
2 changed files with 24 additions and 0 deletions
|
@ -1,4 +1,10 @@
|
|||
{
|
||||
"/etc/*": {
|
||||
"filetype": "conf"
|
||||
},
|
||||
"/home/*/.config/*": {
|
||||
"filetype": "conf"
|
||||
},
|
||||
"autosu": true,
|
||||
"colorscheme": "geany",
|
||||
"mkparents": true
|
||||
|
|
18
etc/skel/.config/micro/syntax/conf.yaml
Normal file
18
etc/skel/.config/micro/syntax/conf.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
filetype: conf
|
||||
|
||||
detect:
|
||||
filename: "(\\.(conf)$|\\.(cfg)$)"
|
||||
|
||||
rules:
|
||||
- constant.string:
|
||||
start: "\""
|
||||
end: "\""
|
||||
skip: "\\\\."
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "(TODO|XXX|FIXME):?"
|
Loading…
Reference in a new issue