Remove mmm-mode, php-mode :: only web-mode

Working in PHP languages with HTML is a daily task.
In the first instance I tried to combine its syntax with multi-web-mode but it consumed a lot of resources.
In the second instance I made the language reader using mmm-mode, reading php-mode in web mode.
However this has not been enough because the color problems between modes produce bugs.

Now only the web-mode for PHP works, and I have managed to activate PHP flycheck for web-mode.
This commit is contained in:
Jesús 2018-11-12 10:59:45 -05:00
parent 9bcab5d262
commit 60be107127
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
5 changed files with 17 additions and 53 deletions

View File

@ -11,7 +11,7 @@
'(ecb-options-version "2.50")
'(package-selected-packages
(quote
(mmm-mode web-mode rainbow-mode yaml-mode scss-mode sass-mode less-css-mode ac-php pkgbuild-mode pip-requirements jedi markdown-mode crystal-mode nginx-mode emmet-mode whitespace-cleanup-mode flycheck neotree all-the-icons highlight-indent-guides anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line ecb diminish undo-tree nlinum sublime-themes use-package))))
(web-mode rainbow-mode yaml-mode scss-mode sass-mode less-css-mode pkgbuild-mode pip-requirements jedi markdown-mode crystal-mode nginx-mode emmet-mode whitespace-cleanup-mode flycheck neotree all-the-icons highlight-indent-guides anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line ecb diminish undo-tree nlinum sublime-themes use-package))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View File

@ -52,7 +52,6 @@
(require 'init-markdown)
(require 'init-python)
(require 'init-pkgbuild)
(require 'init-php)
(require 'init-less)
(require 'init-sass)
(require 'init-scss)
@ -60,7 +59,6 @@
;; Plus
(require 'init-rainbow)
(require 'init-web-mode)
(require 'init-mmm-mode)
(require 'init-ready)
;;; Loads custom file

View File

@ -6,8 +6,21 @@
;; (add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
(add-hook 'html-mode-hook 'flycheck-mode)
(add-hook 'js-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'flycheck-mode)
(add-hook 'mmm-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'flycheck-mode))
(add-hook 'web-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'flycheck-mode)
:config
;; support web-mode with PHP
(flycheck-define-checker mix-php
"A PHP syntax checker using the PHP command line interpreter.
See URL `https://php.net/manual/en/features.commandline.php'."
:command ("php" "-l" "-d" "error_reporting=E_ALL" "-d" "display_errors=1"
"-d" "log_errors=0" source)
:error-patterns
((error line-start (or "Parse" "Fatal" "syntax") " error" (any ":" ",") " "
(message) " in " (file-name) " on line " line line-end))
:modes (php-mode php+-mode web-mode))
(add-to-list 'flycheck-checkers 'mix-php)
)
(provide 'init-flycheck)

View File

@ -1,29 +0,0 @@
(use-package mmm-mode
:config
(setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class nil "\\.php?\\'" 'html-php)
(mmm-add-mode-ext-class nil "\\.ctp?\\'" 'html-php)
(set-face-background 'mmm-default-submode-face nil)
(mmm-add-group 'html-php
'((html-php-output
:submode php-mode
:face mmm-output-submode-face
:front "<\\?php *echo "
:back "\\(\\?>\\|\\'\\)"
:include-front t
:front-offset 5
:insert ((?e php-echo nil @ "<?php" @ " echo " _ " " @ "?>" @))
)
(html-php-code
:submode php-mode
:face mmm-code-submode-face
:front "<\\?\\(php\\)?"
:back "\\(\\?>\\|\\'\\)"
:insert ((?p php-section nil @ "<?php" @ " " _ " " @ "?>" @)
(?b php-block nil @ "<?php" @ "\n" _ "\n" @ "?>" @))
)))
)
(provide 'init-mmm-mode)

View File

@ -1,18 +0,0 @@
(use-package php-mode)
(use-package ac-php
:config
(add-hook 'mmm-mode-hook
'(lambda ()
(auto-complete-mode t)
(require 'ac-php)
(setq ac-sources '(ac-source-php ))
(setq ac-sources '(ac-source-dictionary ac-source-abbrev ac-source-php ))
(ac-php-core-eldoc-setup ) ;; enable eldoc
(define-key php-mode-map (kbd "C-]") 'ac-php-find-symbol-at-point) ;; goto define
(define-key php-mode-map (kbd "C-t") 'ac-php-location-stack-back))) ;; go back
)
(provide 'init-php)