Skip to content

Daylily-Zeleen/GDScript-Formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Badge

GDScript Formatter

icon

A Godot Editor (4.x) addon for formatting GDScript automatically.

Features:

  • Format with shortcut
    • Defaults to Shift+Alt+F
  • Format on save
  • Format through tool menu
    • Project -> Tool -> GDScript Formatter: Format script
  • Format through command palette
    • Open the command palette (Default Ctrl+Shift+P) and run command Format GDScript

Installation

GDScript Formatter relies on GDToolkit which uses Python and Pip package manager. You need to install them in order to use the addon.

  1. Install Python (if you do not have it already)
  2. Install the Godot plugin
    • In Godot editor, click "AssetLib" and search "GDScript Formatter"
    • Install the plugin
    • Enable the plugin through Project -> Project Settings -> Plugins
  3. Install GDToolkit
    • Project -> Tool -> GDScript Formatter: Install/Update gdtoolkit

Editing Preferences

You can edit GDScript Formatter's behavior through the preferences file. Preferences are stored as a Godot resource located in res://addons/gdscript_formatter/format_preference.tres. Double click the file from Godot and you can change whether files are formatted on save, the gdformat command, line length, and other values.