Stop using Org for PHP config

This commit is contained in:
Tom Willemse 2018-06-19 10:40:09 -07:00
parent 67c2b8ed1f
commit 0179fa3abe
2 changed files with 19 additions and 51 deletions

View file

@ -0,0 +1,19 @@
(eval-when-compile (require 'company))
(add-hook 'php-mode-hook 'electric-pair-local-mode)
(add-hook 'php-mode-hook 'electric-indent-local-mode)
(add-hook 'php-mode-hook 'flycheck-mode)
(defun oni:set-require-final-newline ()
(setq require-final-newline t))
(add-hook 'php-mode-hook 'oni:set-require-final-newline)
(add-hook 'php-mode-hook 'company-mode)
(with-eval-after-load 'company
(add-to-list 'company-backends 'company-ac-php-backend))
(add-hook 'php-mode-hook 'ggtags-mode)

View file

@ -1,51 +0,0 @@
#+TITLE: PHP
Turn on electric pairing in php-mode.
#+BEGIN_SRC emacs-lisp
(add-hook 'php-mode-hook 'electric-pair-local-mode)
#+END_SRC
Turn on electric indenting in php-mode.
#+BEGIN_SRC emacs-lisp
(add-hook 'php-mode-hook 'electric-indent-local-mode)
#+END_SRC
Enable flycheck in php-mode.
#+BEGIN_SRC emacs-lisp
(add-hook 'php-mode-hook 'flycheck-mode)
#+END_SRC
Reset =require-final-newline= because the default php-mode style
disables it.
#+BEGIN_SRC emacs-lisp
(defun oni:set-require-final-newline ()
(setq require-final-newline t))
(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
Enable ggtags-mode for tags browsing with global.
#+BEGIN_SRC emacs-lisp
(add-hook 'php-mode-hook 'ggtags-mode)
#+END_SRC