Skip to content

Code Formatter

ZetoPad includes a code formatter to keep your snippets clean and consistent.

Formatting Code

  1. Open a code snippet
  2. Press Cmd+Shift+F to format
  3. Or right-click and select “Format Code”

Format on Save

Enable automatic formatting when you save:

  1. Open Settings > Editor
  2. Enable “Format on Save”

Now every Cmd+S will format and save.

Formatter Panel

Open the Formatter Panel to configure options:

  1. Click the formatter icon in the toolbar
  2. Or use Command Palette: “Toggle Formatter Panel”

Supported Languages

LanguageFormatter
JavaScriptBuilt-in
TypeScriptBuilt-in
JSONBuilt-in
HTMLBuilt-in
CSSBuilt-in
MarkdownBuilt-in
PythonExternal (if installed)
RustExternal (if installed)
GoExternal (if installed)

Configuration Options

Indentation

OptionValues
TypeSpaces or Tabs
Size2, 4, or 8

Line Length

Set the preferred maximum line length for wrapping:

  • 80 (traditional)
  • 100 (common)
  • 120 (wider screens)

Other Options

  • Trailing Commas - Add commas after last item
  • Semicolons - Include or omit semicolons (JS/TS)
  • Quote Style - Single or double quotes
  • Bracket Spacing - { foo } vs {foo}

JSON Formatting

For JSON snippets, formatting:

  • Validates JSON syntax
  • Applies consistent indentation
  • Sorts keys (optional)
  • Removes trailing commas

Minify JSON

Right-click and select “Minify” to compress JSON to a single line.

External Formatters

For languages not built-in, ZetoPad can use external formatters if installed:

LanguageFormatterInstall
PythonBlackpip install black
Rustrustfmtrustup component add rustfmt
GogofmtIncluded with Go

Configure external formatter paths in Settings if they’re not in your PATH.

Per-Language Settings

Override global settings for specific languages:

{
"formatter": {
"javascript": {
"tabSize": 2,
"semicolons": false
},
"python": {
"lineLength": 88
}
}
}