Format code on saving script plugin for Godot 4
Find a file
2025-09-08 09:23:52 +02:00
rules Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00
screenshots Init 2025-04-24 23:15:00 +07:00
test Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00
.gitattributes Remove blank lines for inline if, spacing for var assignment 2025-06-24 21:35:46 +07:00
.gitignore Init 2025-04-24 23:15:00 +07:00
formatter.gd Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00
formatter.gd.uid Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00
LICENSE.md Init 2025-04-24 23:15:00 +07:00
LICENSE.txt Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00
plugin.cfg Update README and version number 2025-09-08 09:18:39 +02:00
README.md Add optional rules explanations 2025-09-08 09:23:52 +02:00
simple_format_on_save.gd Add new user settings "blank after dedent" 2025-09-08 09:19:51 +02:00
simple_format_on_save.gd.uid Reorganizing for submodule addition 2025-09-08 09:16:16 +02:00

Simple Format On Save 🌠

Original plugin by ducviet321

A Godot addon that automatically formats GDScript whenever you save it.

Screenshot

Features

  • Does not require gdtoolkit
  • Automatic code formatting when saving files
  • Clean and consistent code style
  • Zero configuration, lightweight and simple to use

Installation

  1. Download or clone this repository as a submodules into addons/SimpleFormatOnSave
  2. Enable the plugin in Project Settings -> Plugins

Formatting Rules

The addon applies the following formatting rules to your GDScript code:

  • Consistent indentation using tabs
  • 2 blank lines between functions
  • No trailing whitespace
  • Space before statements (if, for, while...)
  • Space after code block
  • No extra blank lines at the start or end of files
  • Proper spacing around parentheses and brackets

Optionals rules

Some rules can be changed in Editor Settings -> Text Editor -> Format on Save

Rule Desc Default state
blank_after_dedent Let a blank line after any dedent false

Usage

Simply save your GDScript files (.gd) and the addon will automatically format them according to the rules above.

License

See the LICENSE file for details.

Special Thanks 🎈

This addon combines the functionality of

🐰 simple_gdscript_formatter by madwind 🐰 Format On Save by ryan-haskell