doomemacs/modules/module-sh.el

32 lines
1.3 KiB
EmacsLisp
Raw Normal View History

2016-05-13 00:29:07 -04:00
;;; module-sh.el
2015-09-28 14:22:26 -04:00
2016-05-13 00:29:07 -04:00
(use-package sh-script
:mode ("\\.\\(ba\\|z\\)sh$"
"/\\.?z\\(sh\\(/.*\\|$\\)\\|profile\\|log\\(in\\|out\\)\\|sh\\(rc\\|env\\)\\)$"
"/\\.?bash\\(/.*\\|rc\\|_profile\\)$")
:init
(add-hook! sh-mode
'(flycheck-mode narf|sh-extra-font-lock-activate))
:config
(def-company-backend! sh-mode (shell))
(def-electric! sh-mode :words ("else" "elif" "fi" "done"))
(def-repl! sh-mode narf/inf-shell)
2016-04-20 01:50:55 -04:00
(setq sh-indent-after-continuation 'always)
2016-05-13 00:29:07 -04:00
;; [pedantry intensifies]
(add-hook! sh-mode (setq mode-name "sh"))
2016-03-28 21:39:13 -04:00
(sp-with-modes '(sh-mode)
(sp-local-pair "case" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
(sp-local-pair "if" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
(sp-local-pair "for" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
(sp-local-pair "elif" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))
(sp-local-pair "while" "" :when '(("SPC")) :post-handlers '((:add narf/sp-insert-yasnippet)) :actions '(insert))))
2015-09-28 14:22:26 -04:00
(use-package company-shell
:after sh-script
:config (setq company-shell-delete-duplicates t))
2015-09-28 14:22:26 -04:00
(provide 'module-sh)
;;; module-sh.el ends here