Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get YAML syntax highlighting in PyCharm?

Tags:

PyCharm doesn't seem to support YAML Syntax highlighting by default. Is there a plugin? I didn't see anything obvious when I Googled for one.

like image 695
travis1097 Avatar asked Nov 14 '13 00:11

travis1097


People also ask

How do I view YAML?

How to open a YAML file. You can open a YAML file in any text editor, such as Microsoft Notepad (Windows) or Apple TextEdit (Mac). However, if you intend to edit a YAML file, you should open it using a source code editor, such as NotePad++ (Windows) or GitHub Atom (cross-platform).

What is YAML syntax?

YAML syntaxYAML has features that come from Perl, C, XML, HTML, and other programming languages. YAML is also a superset of JSON, so JSON files are valid in YAML. YAML uses Python-style indentation to indicate nesting. Tab characters are not allowed, so whitespaces are used instead.


2 Answers

This works for me in the community edition: File -> Settings -> File Types -> Add a type for yaml

I didn't do anything else except set '#' as the line-comment character.

This colors basic names, values, strings and comments nicely.

enter image description here

If you can't find the option, search for "File Types" in the search box in the Preferences window.

like image 100
rupello Avatar answered Sep 23 '22 06:09

rupello


  1. Go to Settings
  2. Code Style
  3. Yaml

If you don't see this, you're probably using the community edition where I didn't find a way to get Yaml highlighting working.

like image 41
user2636840 Avatar answered Sep 21 '22 06:09

user2636840