Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Customize your FormatterNew to Visual Studio Code? Get it now.
Customize your Formatter

Customize your Formatter

franneck94

|
582 installs
| (0) | Free
🔧 Add customized scripts to the formatters. 🔧
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Custom Local Formatters

With this extension you can add scripts to your formatter that will be run afterwards.
So for example if you have selected clang-format for C/C++ files, you can add a python script that is run on the output of clang-format, to add some very specialised formattting style that clang-format does not allow out of the box.

Quickstart

  1. Install this extension

  2. Define your custom formatting script. Scripts will receive the contents of the file to be formatted over STDIN. They should output the formatted results over STDOUT.

  3. Configure the extension to run your script on files of the right type. The script will be run with a working directory of the workspace root. Valid language identifiers can be found here.

      "customizeFormatter.formatters": [
        {
          "command": "python format-yml-files.py",
          "languages": ["cpp"]
        }
      ]
    
  4. That's it! Your script is now integrated with VSCode as an official formatter. You can now format your code though the Format Document command (shift+alt+f), enable the editor.formatOnSave option, or use the formatter however else VSCode allows.

Copyright Note

This extension lets you run a user defined script to format your files.
It is based on https://marketplace.visualstudio.com/items?itemName=jkillian.custom-local-formatters

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