Skip to content

amake/shfmt.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shfmt.el

Shell script formatting and linting with shfmt

Installation

Install shfmt per instructions.

shfmt.el is not (yet) on MELPA so install it locally however you like. You will have to install reformatter and flycheck separately.

Configuration

Manual formatting requires no configuration; just call shfmt-buffer or shfmt-region. Enable shfmt-on-save-mode to auto-format on save. Add this to the sh-mode-hook to enable automatically in new buffers.

Call flycheck-shfmt-setup to enable the Flycheck checker.

Example

Using use-package, assuming installed locally to lisp/shfmt:

(use-package shfmt
  :ensure nil
  :load-path "lisp/shfmt"
  :ensure-system-package shfmt
  :hook (sh-mode . shfmt-on-save-mode))

(use-package flycheck-shfmt
  :ensure nil
  :after flycheck
  :load-path "lisp/shfmt"
  :config
  (flycheck-shfmt-setup))

License

GPL-3

About

Shell script formatting and linting for Emacs via shfmt

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors