Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

benjamineskola/shfmt.novaextension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shfmt Nova Extension

It’s a stand-alone Nova extension to use Shfmt, based on Aeron's Black extension.

Requirements

Before using the extension, it’s necessary to install Shfmt itself if you haven't already.

Shfmt can be installed simply by running brew install shfmt.

Configuration

The extension supports both global and workspace configurations. A workspace configuration always overrides a global one.

Options

There are three extension options available to configure: executable path, command arguments, and format on save. By default, the executable is searched for in the PATH, with no additional arguments, and formatting on saving is on.

There are also a number of formatting options to configure: indentation size, POSIX compatibility, and simplification mode. All of these default to the Shfmt defaults: tab indentation, Bash compatibility, no simplification.

Other options can be set using the command arguments option, which will override the others in case of a conflict.

Credits

The bulk of the code is from Aeron's Black extension. All I've done is swap out the executable for Shfmt. The extension logo is from nova-shellcheck and is MIT licenced.

About

Format shell scripts on save in Nova editor

Resources

License

Stars

Watchers

Forks

Packages

No packages published