doomemacs/modules/lang/sh/config.el

29 lines
838 B
EmacsLisp
Raw Normal View History

2017-02-19 18:57:16 -05:00
;;; lang/sh/config.el
2015-09-28 14:22:26 -04:00
(def-package! sh-script ; built-in
2017-02-19 18:57:16 -05:00
:mode (("\\.zsh$" . sh-mode)
("/bspwmrc$" . sh-mode))
2017-02-19 18:57:16 -05:00
:init
(add-hook! sh-mode '(flycheck-mode highlight-numbers-mode +sh|extra-fontify))
2016-05-13 00:29:07 -04:00
:config
(set! :electric 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
(set! :repl 'sh-mode '+sh/repl)
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"))
2015-09-28 14:22:26 -04:00
2017-02-19 18:57:16 -05:00
(defun +sh|detect-zsh ()
(when (and buffer-file-name (string-match-p "\\.zsh\\'" buffer-file-name))
(sh-set-shell "zsh")))
(add-hook 'sh-mode-hook '+sh|detect-zsh))
(def-package! company-shell
:when (featurep! :completion company)
:after sh-script
2017-03-20 16:32:29 -04:00
:config
(set! :company-backend 'sh-mode '(company-shell))
(setq company-shell-delete-duplicates t))