doomemacs/modules/module-sh.el

37 lines
1.5 KiB
EmacsLisp
Raw Normal View History

2015-09-29 02:22:26 +08:00
;;; module-sh.el --- description
2016-02-11 15:08:53 +08:00
(use-package company-shell
:defer t
:config
(setq company-shell-delete-duplicates t))
2016-04-09 04:15:00 +08:00
(associate! sh-mode :match "\\.\\(ba\\|z\\)sh$")
(associate! sh-mode :match "/\\.?z\\(sh\\(/.*\\|$\\)\\|profile\\|login\\|logout\\|shrc\\|shenv\\)$")
(associate! sh-mode :match "/\\.?bash\\(/.*\\|rc\\|_profile\\)$")
(after! sh-script
2016-03-30 11:13:31 +08:00
(add-hook 'sh-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'narf|sh-extra-font-lock-activate) ; Fontify variables in strings
2016-03-23 23:59:06 +08:00
(add-hook! sh-mode
(electric-indent-local-mode +1)
(setq narf-electric-indent-words '("else" "elif" "fi" "done")))
2016-03-30 11:13:31 +08:00
(define-repl! sh-mode narf/inf-shell)
(setq sh-indent-after-continuation 'always)
;; [pedantry intensifies]
(defadvice sh-mode (after sh-mode-rename-modeline activate)
(setq mode-name "sh"))
2016-02-11 15:08:53 +08:00
2016-03-30 11:13:31 +08:00
(require 'company-shell)
2016-03-29 09:39:13 +08: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-29 02:22:26 +08:00
(provide 'module-sh)
;;; module-sh.el ends here