2015-06-15 09:06:10 +02:00
|
|
|
;;; module-php.el
|
|
|
|
|
|
|
|
(use-package php-mode
|
|
|
|
:mode "\\.\\(php\\|inc\\)$"
|
|
|
|
:init
|
2016-02-20 15:30:30 -05:00
|
|
|
(define-docset! php-mode "php,laravel")
|
|
|
|
(define-company-backend! php-mode '(php-extras-company))
|
|
|
|
|
2015-09-28 05:51:46 -04:00
|
|
|
(add-hook! php-mode 'flycheck-mode)
|
2015-06-25 23:47:03 +02:00
|
|
|
(setq php-template-compatibility nil
|
|
|
|
php-extras-eldoc-functions-file (concat narf-temp-dir "php-extras-eldoc-functions"))
|
2015-06-15 09:06:10 +02:00
|
|
|
:config
|
|
|
|
(require 'php-extras)
|
2015-12-27 02:51:49 -05:00
|
|
|
(defun php-extras-company-setup ()) ;; company will set up itself
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2015-11-17 02:09:34 -05:00
|
|
|
(unless (file-exists-p (concat php-extras-eldoc-functions-file ".el"))
|
|
|
|
(async-start `(lambda ()
|
|
|
|
,(async-inject-variables "\\`\\(load-path\\|php-extras-eldoc-functions-file\\)$")
|
|
|
|
(require 'php-extras-gen-eldoc)
|
|
|
|
(php-extras-generate-eldoc-1 t))
|
|
|
|
(lambda (_)
|
|
|
|
(load (concat php-extras-eldoc-functions-file ".el"))
|
|
|
|
(message "PHP eldoc updated!"))))
|
|
|
|
|
2015-06-15 09:06:10 +02:00
|
|
|
;; TODO Tie into emr
|
|
|
|
(require 'php-refactor-mode)
|
|
|
|
(add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode)))
|
|
|
|
|
2015-12-09 01:54:30 -05:00
|
|
|
(use-package php-boris :defer t
|
|
|
|
:init
|
|
|
|
(define-repl! php-mode php-boris)
|
|
|
|
:config
|
|
|
|
(evil-set-initial-state 'php-boris-mode 'emacs)
|
|
|
|
(setq php-boris-command "~/.dotfiles/scripts/run-boris"))
|
2015-11-25 06:00:49 -05:00
|
|
|
|
2015-10-09 18:00:39 -04:00
|
|
|
(use-package hack-mode :mode "\\.hh$")
|
|
|
|
|
2016-02-04 18:53:08 -05:00
|
|
|
(define-minor-mode php-laravel-mode
|
|
|
|
""
|
|
|
|
:init-value nil
|
|
|
|
:lighter " Laravel"
|
|
|
|
:keymap (make-sparse-keymap)
|
|
|
|
(add-yas-minor-mode! 'php-laravel-mode))
|
|
|
|
(associate! php-laravel-mode
|
|
|
|
:in (php-mode json-mode yaml-mode web-mode nxml-mode js2-mode scss-mode)
|
|
|
|
:files ("artisan" "server.php"))
|
|
|
|
|
2015-06-15 09:06:10 +02:00
|
|
|
(provide 'module-php)
|
|
|
|
;;; module-php.el ends here
|