Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>yamlfmt - A YAML formatterNew to Visual Studio Code? Get it now.
yamlfmt - A YAML formatter

yamlfmt - A YAML formatter

Kenichi Kamiya

|
3,839 installs
| (0) | Free
Format yaml files with https://github.com/google/yamlfmt
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code Extension - yamlfmt

Usage

The binary must exist in the system path.

code --install-extension kachick.vscode-yamlfmt

Add these config in your settings.json

{
  "editor.formatOnSave": true,
  "[yaml]": {
    "editor.defaultFormatter": "kachick.vscode-yamlfmt"
  },
  "[github-actions-workflow]": {
    "editor.defaultFormatter": "kachick.vscode-yamlfmt"
  }
}

Configuration

If the file is not opened from a workspace, the extension will fallback to the files parent directory as cwd. If that is not sufficient to pick up the right config file, you can create a .yamlfmt at one of the common locations. i.e. ~/config/yamlfmt/ or export XDG_CONFIG_HOME. Alternatively point to the right at via the -conf flag, in your settings.json.

You can pass extra flags from the settings.json:

{
  "yamlfmt.args": []
}

Note The flag -in is always appended to the args, since the current document is passed via stdin to yamlfmt.

Thanks

This repository is now forked for my use, the original is bluebrown/vscode-extension-yamlfmt

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