From 255736783fb55ba5b39336bd96a958d0ca917351 Mon Sep 17 00:00:00 2001 From: kj Date: Tue, 4 Aug 2020 01:05:30 -0400 Subject: [PATCH] Eliminado web-mode en favor de multi-web-mode. --- init.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/init.el b/init.el index 22bf3fa..0c02bd3 100644 --- a/init.el +++ b/init.el @@ -51,7 +51,7 @@ '(magit-diff-use-overlays nil) '(package-selected-packages (quote - (spacemacs-theme flycheck ac-emmet web-mode ac-html markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f evil dash-functional))) + (multi-web-mode spacemacs-theme flycheck ac-emmet markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f evil dash-functional))) '(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e"))) '(pos-tip-background-color "#FFFACE") '(pos-tip-foreground-color "#272822") @@ -137,19 +137,19 @@ (global-set-key (kbd "C-S-d") 'mc/mark-all-like-this) ;Seleccionar todos como el actual (global-set-key (kbd "C-S-") 'mc/add-cursor-on-click) ;Añadir cursor con clics (Shift+CTRL+Clic) -(require 'web-mode) -(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) -(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) -(setq web-mode-css-indent-offset 2 - web-mode-code-indent-offset 2 - web-mode-sql-indent-offset 2 - web-mode-script-padding 2 - web-mode-markup-indent-offset 2) +; Cambiar de modos en un archivo que tiene php, html, css y js a la vez. +(require 'multi-web-mode) +(setq mweb-default-major-mode 'html-mode) +(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>") + (js-mode "") + (css-mode ""))) +(setq mweb-filename-extensions '("php" "htm" "html")) +(multi-web-global-mode 1) + +;Habilitar siempre auto-complete-mode en html-mode +(add-hook 'html-mode-hook #'(lambda() + (auto-complete-mode) + )) (powerline-default-theme); Habilitar powerline (esa línea bonita de abajo del editor) @@ -159,4 +159,3 @@ (setq c-basic-offset 2) ; Cambio los tabs por 2 espacios (PSR recomienda 4, pero editores como atom y VScode al momento de que configuro esto usan 2 y prefiero mantener esa compatibilidad entre editores) ; (web-mode) ;Pongo PHP siempre en webmode en caso de tener php-mode )) -