doomemacs/modules/module-sh.el

30 lines
1.3 KiB
EmacsLisp
Raw Normal View History

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