2015-09-28 14:22:26 -04:00
|
|
|
;;; module-sh.el --- description
|
|
|
|
|
2016-04-08 16:15:00 -04:00
|
|
|
(associate! sh-mode :match "\\.\\(ba\\|z\\)sh$")
|
|
|
|
(associate! sh-mode :match "/\\.?z\\(sh\\(/.*\\|$\\)\\|profile\\|login\\|logout\\|shrc\\|shenv\\)$")
|
2015-12-23 03:43:30 -05:00
|
|
|
(associate! sh-mode :match "/\\.?bash\\(/.*\\|rc\\|_profile\\)$")
|
2016-04-23 22:08:46 -04:00
|
|
|
(def-electric! sh-mode :words ("else" "elif" "fi" "done"))
|
2016-04-20 01:50:55 -04:00
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
(after! sh-script
|
|
|
|
(def-repl! sh-mode narf/inf-shell)
|
2016-04-20 01:50:55 -04:00
|
|
|
(setq sh-indent-after-continuation 'always)
|
|
|
|
|
|
|
|
(add-hook! sh-mode (setq mode-name "sh")) ; [pedantry intensifies]
|
2016-03-23 11:59:06 -04:00
|
|
|
(add-hook! sh-mode
|
2016-04-23 22:08:46 -04:00
|
|
|
'(flycheck-mode
|
|
|
|
;; Fontify variables in strings
|
|
|
|
narf|sh-extra-font-lock-activate))
|
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
|
|
|
|
2016-04-23 22:08:46 -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
|