/nash-mode.el

Emacs mode for the Nash shell scripting

Primary LanguageEmacs LispBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

MELPA

nash-mode

This package provides an Emacs major mode for Nash Shell. You can install using Melpa or cloning this repository directly.

It provides simple fontification and integration with nashfmt.

There are several ways to use nash-mode and the code below are just examples.

;;; Add nash-mode cloned source code to load-path
(add-to-list 'load-path "<path-to-nash-mode.el>")

(require 'nash-mode)

;; to use nash-mode for sh scripts (instead of sh-mode)
(add-to-list 'auto-mode-alist '("\\.sh\\'" . nash-mode))
(add-hook 'nash-mode-hook 'nash-fmt-enable-on-save)

If you prefer through use-package.

(use-package nash-mode
  :ensure t
  :commands (nash-mode)
  ;; to use nash-mode for sh scripts (instead of sh-mode)
  :mode "\\.sh\\'"
  :init (add-hook 'nash-mode-hook #'nash-fmt-enable-on-save))