From 4813d15f0e71aa45290631667715f072426ba78f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 14 Oct 2016 00:58:15 +0200 Subject: [PATCH] Enable company mode in PHP mode --- emacs/.emacs.d/init/php-mode-init.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/emacs/.emacs.d/init/php-mode-init.org b/emacs/.emacs.d/init/php-mode-init.org index 60bdb20..0b425fe 100644 --- a/emacs/.emacs.d/init/php-mode-init.org +++ b/emacs/.emacs.d/init/php-mode-init.org @@ -27,3 +27,19 @@ disables it. (add-hook 'php-mode-hook 'oni:set-require-final-newline) #+END_SRC + +Enable company mode for completion. + +#+BEGIN_SRC emacs-lisp + (add-hook 'php-mode-hook 'company-mode) +#+END_SRC + +Load a PHP-specific completion back-end when company mode is loaded. + +#+BEGIN_SRC emacs-lisp + (eval-when-compile (require 'company)) + + (with-eval-after-load 'company + (require 'company-php) + (add-to-list 'company-backends 'company-ac-php-backend)) +#+END_SRC