Enable company mode for shell scripts.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 26 Jan 2017 17:27:01 +0200
changeset 1460 d6606777ff0a
parent 1459 6beb77e22575
child 1461 2b12d4f7f8a4
Enable company mode for shell scripts.
.emacs-my
--- a/.emacs-my	Thu Jan 26 17:09:36 2017 +0200
+++ b/.emacs-my	Thu Jan 26 17:27:01 2017 +0200
@@ -3372,6 +3372,14 @@
 
 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
 
+(defun my/sh-company-setup ()
+  (make-local-variable 'company-backends)
+  (setq company-backends '((company-capf company-files)))
+  (company-mode 1))
+
+(when (featurep 'company)
+  (add-hook 'sh-mode-hook #'my/sh-company-setup))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "pg, Proof General")