Ticket #3293 (closed enhancement: fixed)

Opened 2 years ago

Last modified 4 months ago

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

yaml.syntax (323 bytes) - added by RoBe 4 months ago.
result.png (28.2 KB) - added by RoBe 4 months ago.
3293-YAML-syntax-fixes.patch (2.4 KB) - added by mooffie 4 months ago.

Change History

Changed 4 months ago by RoBe

Changed 4 months ago by RoBe

comment:1 Changed 4 months 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 4 months ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.19

comment:3 Changed 4 months 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

comment:4 Changed 4 months ago by andrew_b

  • Status changed from testing to closed

comment:5 Changed 4 months 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.

Changed 4 months ago by mooffie

comment:6 Changed 4 months 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 4 months 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 4 months ago by andrew_b

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.