Home

Awesome

KV4Jetbrains

Syntax highlighting and auto-completion for Kivy/KivyMD .kv files in PyCharm/Intellij IDEA

kv_code

This settings file is based on the one that is located at the "Setting Up Kivy with various popular IDE's" page of Kivy@GitHub.
It's updated and has also support for the KivyMD modules and properties.


There are 4 categories of keywords:

The colors of these categories can be changed in Settings>Editor>Color Scheme>Custom.

<p align="center"> <a href="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.colors.png"> <img src="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.colors.png" height="350"></a> </p>

You can Add/Remove keywords by going to the Settings>Editor>File Types and double click (edit) the Kv Language entry.

<p align="center"> <a href="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.edit.png"> <img src="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.edit.png" height="300"></a> <a href="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.keywords.png"> <img src="https://raw.githubusercontent.com/noembryo/KV4Jetbrains/master/img/kv.keywords.png" height="300"></a> </p>

Also, feel free to inform me about missing keywords so that I can update the settings file.


Installation instructions for PyCharm/Intellij IDEA:


Semi-Language Injection to String Literals

Added in v0.3

PyCharm, IDEA (and all the JetBrains IDE's) support "Language Injection", a way to have syntax highlighting inside the Python's string literals.
Unfortunately, only the supported languages are supported (!)

There is a workaround (better than nothing, but not by much), to have something like this:

kv_code

You can read about it here.

To use it, just select all the kv code in the string, press Ctrl+Alt+T ("Surround With...") and select the KV. Surround for kv injection entry.