Ticket #3293 (closed enhancement: fixed)
YAML support in mcedit
Reported by: | dyasny | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.19 |
Component: | mcedit | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
Using mcedit to work on large YAML files, would be great to see syntax highlighting for YAML.
Thanks,
Dan
Attachments
Change History
comment:1 Changed 8 years ago by RoBe
Hi,
i made a very simple YAML syntax highlighting. Just copy file yaml.syntax into
/usr/share/mc/syntax
Then backup file:
/usr/share/mc/syntax/Syntax
and add to the end:
file ..\*\\.(yml|YML)$ YAML\sFile include yaml.syntax
and than restart mc or use shortcut CTRL + S on opened YAML file (support files *.yml or *.YML).
After that you can see result.png.
comment:2 Changed 8 years ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- Milestone changed from Future Releases to 4.8.19
comment:3 Changed 8 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset set to committed-master
- Resolution set to fixed
- Branch state changed from no branch to merged
Applied as [055a8c6a4fa6840c8999d22038dc09f512bedee7].
Thanks!
comment:5 Changed 8 years ago by mooffie
- Status changed from closed to reopened
- Resolution fixed deleted
The current version is lacking. Here are some fixes/improvements. (I also made it use the colors we usually use.)
(@Roman: Your name is in the commit history. I removed it from the file itself. I'm sure you'll agree with me that it'd be unfair to those coming after you and invest more time in this that they won't get credit.)
BTW, @Roman: what systems are using {{var}}? It won't hurt to document this.
comment:6 Changed 8 years ago by zaytsev
OH MY GOD, AWESOME!!!11 I'm writing a lot of YAML these days, and was thinking to make a call to see if anyone can do a syntax for it.
@mooffie, "{{ var }}" is the Jinja2 (template system for Python) string interpolation syntax. It has nothing to do with YAML per se, but, among other things, YAML is used as a default playbook format for an increasingly popular software configuration mangement system called Ansible, which, incidentally, is written in Python and uses Jinja2 to interpolate YAML strings. So, as such, I'd be happy if you could keep anything "{{ .. }}" highlighted in a different color, such that it stands out.
comment:7 Changed 8 years ago by zaytsev
P.S. I wish someone could think of tackling Scala ;-) the first approximation would be to just alias it to Java, but, of course, there is much more to it...
comment:8 Changed 8 years ago by andrew_b
- Status changed from reopened to closed
- Resolution set to fixed
Applied as [54a0ccecaafff0af41990cff33453bfbb5c63eda].
Thanks!