Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>VSCode Shell-like FormatterNew to Visual Studio Code? Get it now.
VSCode Shell-like Formatter

VSCode Shell-like Formatter

lumirelle

|
8,232 installs
| (6) | Free
Revision of shell-format: A formatter for shell-like scripts, Dockerfile, gitignore, dotenv, /etc/hosts, jvmoptions, and other file types
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Shell-like Formatter For VS Code

Visual Studio Marketplace Version

[!Note]

This is a fork of foxundermoon/vs-shell-format.

Since the original package no longer maintained, I just try to fork this package, fix this issue and re-publish new package to marketplace.

See https://github.com/foxundermoon/vs-shell-format/issues/396.

Get it on the VS Code Marketplace!

Enjoy shellscript!

Supported file types or languages

[!Note]

Dockerfile support is opt-in. It is registered as a language but excluded from the default shellformat.effectLanguages, so it won't format on save unless you enable it.

The upstream tool shfmt does not officially support Dockerfile. However, the common Dockerfile syntax (e.g. RUN with shell commands) falls within the shell grammar, in this case, shfmt can format Dockerfille. Because this is not an officially supported path and may mangle complex multiline constructs, it is disabled by default — enable it only if it works for your use case.

To enable, add dockerfile to shellformat.effectLanguages, or enable shellformat.useEditorConfig and add the following to your .editorconfig:

[Dockerfile]
indent_size = 4
indent_style = space
binary_next_line = true

See #14 for background.

language extension describe
shellscript .sh .bash shell script files
dockerfile Dockerfile *.dockerfile dockerfile (opt-in)
ignore .gitignore .dockerignore ignore files
properties .properties java properties files
jvmoptions .vmoptions , jvm.options jvm options file
hosts /etc/hosts hosts file
bats .bats Bats test file
zsh .zsh .zshrc .zshenv zsh script files

screenshot

Usage

shift+option+f

shift+command+p then type Format Document

Dependencies

  • shfmt

Custom configuration

  • shellformat.path the shfmt fullpath example [mac,linux]: /usr/local/bin/shfmt [windows]: C:\\bin\\shfmt.exe
  • shellformat.flag shfmt -h to see detailed usage.

Links

Source code

shfmt (mvdan/sh)

Contributors of the original project

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Sponsors

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft