From 806f73fef712ef4e8a48e6126f3ebc1e5f5f5d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Thu, 16 Feb 2023 20:20:58 +0000 Subject: [PATCH] Trying out web-mode --- config.org | 31 +++++++++++++++--------- snippets/{css-mode => web-mode}/bbox | 0 snippets/{html-mode => web-mode}/ficlink | 0 snippets/{html-mode => web-mode}/skel | 0 snippets/{html-mode => web-mode}/sumdet | 0 5 files changed, 20 insertions(+), 11 deletions(-) rename snippets/{css-mode => web-mode}/bbox (100%) rename snippets/{html-mode => web-mode}/ficlink (100%) rename snippets/{html-mode => web-mode}/skel (100%) rename snippets/{html-mode => web-mode}/sumdet (100%) diff --git a/config.org b/config.org index dfffa67..57235d9 100644 --- a/config.org +++ b/config.org @@ -739,16 +739,6 @@ Use the superior package for viewing PDFs on the superior operating system, and (setq pdf-view-resize-factor 1.1))) #+END_SRC -** =rainbow-mode= - -Adds visual indication of colours to CSS files. - -#+BEGIN_SRC emacs-lisp - (use-package rainbow-mode - :hook - (css-mode . rainbow-mode)) -#+END_SRC - ** =recentf= Gives me a dialog with recently opened files. Package management and =elfeed= stuff have to be manually excluded for obvious reasons. Surely I don’t have to call =add-to-list= separately every time, but I haven’t found a more sensible way of doing it. @@ -807,6 +797,25 @@ Automatically use smart quotes. (Can’t be set to =text-mode-hook=, unfortunate (add-hook 'org-mode-hook 'unsmart-hook) #+END_SRC +** =web-mode= + +This is good for auto indentation, folding, killing elements, apparently XPath?? but I’ve failed to make faces work like the do in normal =html-mode=. + +#+BEGIN_SRC emacs-lisp + (use-package web-mode + :mode (("\\.html?\\'" . web-mode) + ("\\.css" . web-mode)) + :config + (setq web-mode-markup-indent-offset 2) + (setq web-mode-css-indent-offset 2) + (setq web-mode-enable-html-entities-fontification t) + (setq web-mode-enable-current-element-highlight t) + :bind + ("C-c /" . web-mode-element-close) + :custom-face + (web-mode-html-entity-face ((t (:underline t))))) +#+END_SRC + ** =yasnippet= Per-mode text expansion. What a lifechanger. @@ -862,7 +871,7 @@ Nice monochrome-ish light theme, reminiscent of [[https://edwardtufte.github.io/ #+BEGIN_SRC emacs-lisp (use-package tao-theme) (load-theme 'tao-yang t) -#+END_SRC +#+end_SRC ** Colours diff --git a/snippets/css-mode/bbox b/snippets/web-mode/bbox similarity index 100% rename from snippets/css-mode/bbox rename to snippets/web-mode/bbox diff --git a/snippets/html-mode/ficlink b/snippets/web-mode/ficlink similarity index 100% rename from snippets/html-mode/ficlink rename to snippets/web-mode/ficlink diff --git a/snippets/html-mode/skel b/snippets/web-mode/skel similarity index 100% rename from snippets/html-mode/skel rename to snippets/web-mode/skel diff --git a/snippets/html-mode/sumdet b/snippets/web-mode/sumdet similarity index 100% rename from snippets/html-mode/sumdet rename to snippets/web-mode/sumdet