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

Nginx Config Formatter

Aaaaron Zhou

|
3,550 installs
| (0) | Free
A formatter with minimal configurations for nginx config files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nginx Config Formatter

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Rating Stars The MIT License Build Status

A formatter with minimal configurations for Nginx config files, based on nginx-config-formatter.

Features

  • all lines are indented in an uniform manner, with 4 spaces per level
  • neighbouring empty lines are collapsed to at most two empty lines
  • empty lines after { or before } are trimmed
  • curly braces placement follows Java convention
  • whitespaces are collapsed, except in comments and quotation marks

Usage

Use Ctrl/Command + Shift + p to open the command palette, type "format", select "Format Document With..." and click "Nginx Config Formatter" to format the conf file.

image-1

You may also click "Configure Default Formatter..." and select "Nginx Config Formatter" to be your default formatter for conf files.

image-2

Settings

You can configure the extension in Settings. Simply search nginx-config-formatter in Settings tab.

There are 3 configuration options:

  • Indent Style: Set the indent style, space or tab
  • Align: Whether to align the values of all directives in the same block
  • Trailing Blank Lines: Whether to append a trailing blank line after the opening bracket

Changelog

See CHANGELOG

Feedback

Bugs, feature requests and more are welcome here GitHub Issues.

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