Syntax highlighting and auto-completion for Kivy/KivyMD .kv files in PyCharm/Intellij IDEA
.kv
files in PyCharm/Intellij IDEAThis 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:
FloatLayout
, Button
, Image
..)text
, source
, size_hint_x
..)on_release
, on_text
, on_parent
..)app
, cls
, root
, self
, False
, None
, True
keywords)The colors of these categories can be changed in
Settings
>Editor
>Color Scheme
>Custom
.
You can Add/Remove keywords by going to the
Settings
>Editor
>File Types
and double click (edit) the Kv Language
entry.
Also, feel free to inform me about missing keywords so that I can update the settings file.
File
> [Manage IDE Settings
] >Export Settings
and save a backup of your current settings
(in case something goes wrong)JetBrains.kvMD.completion.v0.x.jar
from the releases
File
> [Manage IDE Settings
] >Import Settings
.jar
file and a dialog will open.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:
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.