lang/sh: remove zsh detection

sh-mode already does its own detection for zsh, so this is unnecessary.
This commit is contained in:
Henrik Lissner 2019-10-19 13:52:27 -04:00
parent 9b003e0516
commit e972c97b2e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

12
modules/lang/sh/config.el Normal file → Executable file
View file

@ -49,17 +49,7 @@
(add-hook 'sh-mode-hook #'rainbow-delimiters-mode)
;; autoclose backticks
(sp-local-pair 'sh-mode "`" "`" :unless '(sp-point-before-word-p sp-point-before-same-p))
;; sh-mode has file extensions checks for other shells, but not zsh, so...
(add-hook! 'sh-mode-hook
(defun +sh-detect-zsh-h ()
(when (or (and buffer-file-name
(string-match-p "\\.zsh\\'" buffer-file-name))
(save-excursion
(goto-char (point-min))
(looking-at-p "^#!.+/zsh[$ ]")))
(sh-set-shell "zsh")))))
(sp-local-pair 'sh-mode "`" "`" :unless '(sp-point-before-word-p sp-point-before-same-p)))
(use-package! company-shell