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.
You may also click "Configure Default Formatter..." and select "Nginx Config Formatter" to be your default formatter for conf files.
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