Giter Site home page Giter Site logo

kv4jetbrains's Introduction

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:

  • Modules (e.g. FloatLayout, Button, Image ..)
  • Properties (e.g. text, source, size_hint_x ..)
  • Actions (e.g. on_release, on_text, on_parent ..)
  • Special (The 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.


Installation instructions for PyCharm/Intellij IDEA:

  • Click File> [Manage IDE Settings] >Export Settings and save a backup of your current settings (in case something goes wrong)
  • Download the JetBrains.kvMD.completion.v0.x.jar from the releases
  • Click File> [Manage IDE Settings] >Import Settings
  • Select the .jar file and a dialog will open.
  • Click OK and restart PyCharm ;o)

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.

kv4jetbrains's People

Contributors

noembryo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kv4jetbrains's Issues

Language Injection

Hi! I like your settings file.
Unfortunately, I often write kv-code inside python.

from kivy.lang import Builder

Builder.load_string("""
BoxLayout:
    Widget:
""")

I found feature in PyCharm to make Language injections. (Settings > Editor > Language Injections) but I could not figure out how to use it.
image

Maybe you can add this setting to your settings file?

Missing keywords

Can you generate a new version of the JetBrains.kvMD.completion file.jar? I will send you a new Kivy.xml file with all missing keywords.

Language injection PyCharm warning message

Hello noEmbryo,

I would like to ask for your help.

Have you seen this kind of warnings?
image
image

Language injection only colors the words or it should also hint avaliable attributes (like in a kv file)?
image

Because I have no hint when I use language injection (# kv_start, # kv_end).

Thanks for your help!

Make this into a plugin.

Making this into a plugin can have so many features, from syntax highlighting, to type checking.

I recommend you to check the Plugin Docs and make this into a Plugin.

Missing MD keywords

Dear noEmbryo,

I just would like to draw your attention that there are some new keywords.

Modules:

  1. MDBoxLayout
  2. MDGridLayout
  3. MDStackLayout
  4. MDScreen

Properties:

  1. adaptive_height
  2. adaptive_width
  3. adaptive_size
  4. tertiary_text
  5. increment_width
  6. on_md_bg_color

Currently, these are I have bumbed into...

Read-only Settings Repository

When I use plugin Settings Repository, I cannot Import Settings from file. But I can add Read-only Source (Settings > Tools > Settings Repository).

image

Can you make this repository to use as Read-only Source or create branch for using with this plugin (and specify git+ url with branch name)?

need to update the readme

just to improve the repo,the tutorial of how to install is not updated since pycharm changed a few how to install the settings like this one,but not much

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.