Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Formatto for VS CodeNew to Visual Studio Code? Get it now.
Formatto for VS Code

Formatto for VS Code

damolinx

|
5 installs
| (0) | Free
Formats Ruby files using rubyfmt.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Formatto for VS Code

Formatto integrates rubyfmt to provide Ruby code formatting.

Table of Contents

  • Getting Started
  • Configuration
  • Format Selection
  • Logs

Getting Started

  1. Install rubyfmt. See the official installation guide.
  2. Ensure rubyfmt is available on your system PATH.
    If it is not, configure the path using one of the following:
    • Set "formatto.rubyfmtPath" in your VS Code settings JSON
    • Use Formatto: Rubyfmt Path in the VS Code Settings UI

Formatto will verify that rubyfmt is available before running the formatter and will prompt you if it cannot be found.

Once configured, Formatto will format Ruby files using Format Document, or automatically on save if Editor: Format on Save is enabled.

↑ Back to top

Configuration

Setting Description
formatto.rubyfmtPath Path to the rubyfmt executable. Defaults to rubyfmt.
formatto.enableRangeFormatting Enables experimental support for Format Selection.
formatto.verifyRubyfmt Verifies that rubyfmt is available before running the formatter.

The formatto.rubyfmtPath value defaults to rubyfmt, which is resolved from the system PATH. A full path or a tokenized path may also be used. The following tokens are available:

  • ${userHome}: User home directory
  • ${workspaceFolder}: Workspace folder containing the file being formatted

Examples

"formatto.rubyfmtPath": "${userHome}/bin/rubyfmt"
"formatto.rubyfmtPath": "${workspaceFolder}/bin/rubyfmt"
"formatto.rubyfmtPath": "rubyfmt" // resolved from PATH

↑ Back to top

Format Selection

rubyfmt does not support range formatting. Formatto supports the Format Selection command using custom heuristic logic. This feature is experimental and results may not match Format Document formatting.

DO NOT report issues with selection formatting to the rubyfmt project.

To enable, use the formatto.enableRangeFormatting setting. Changes take effect only after a restart.

↑ Back to top

Logs

Formatto writes diagnostic information to the Formatto output channel.
You can adjust the log level using Developer: Set Log Level and selecting Formatto.
See documentation for details.

↑ Back to top

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft