IMPORTANT NOTICE
Canvas blocks (canvas.before, canvas.after) may cause formatting issues.
Place them at the end of widget definitions for best results.
Help via pull request is welcome!
Professional formatter for Kivy .kv files
In VS Code: Ctrl+Shift+P → "Extensions: Install from VSIX..."
Select the downloaded .vsix file
From Marketplace
Open Extensions view (Ctrl+Shift+X)
Search for "KV Formatter"
Click Install
Usage
Open a .kv file
Position widgets at desired indentation levels
Use Ctrl+Shift+Alt+K (Windows/Linux) or Cmd+Shift+Alt+K (Mac) to format, instead of the standard format command. there were configuration problems, but with the new shortcut it works just as well. You don't need to do anything else
Formatting preserves manual widget positions while auto-indenting properties
Example
#before formatting:
BoxLayout: # ← Position set
Label: # → Position set
text: "Hello" # → will be indented
#after formatting:
BoxLayout: # ← Position set
Label: # → Position set
text: "Hello" # → indented
Golden Rules
Widgets define hierarchy: Place them where you want