From 81a3b67f638e75721bbd763a0c8acc948630a708 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 26 Jun 2022 22:24:49 +0200 Subject: [PATCH] [Emacs] Better web-mode config, cleaner prettier-js config --- org/config/emacs.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/org/config/emacs.org b/org/config/emacs.org index 420847a..9583c4c 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -7251,6 +7251,12 @@ languages in the same buffer, mainly HTML, CSS, and Javascript. ("\\.ctp\\'" . web-mode) ("\\.djhtml\\'" . web-mode) ("\\.vue\\'" . web-mode)) + :config + (csetq web-mode-markup-indent-offset 2 + web-mode-code-indent-offset 2 + web-mode-css-indent-offset 2 + web-mode-style-padding 0 + web-mode-script-padding 0) :general (phundrak/major-leader-key :keymaps 'web-mode-map @@ -7408,11 +7414,9 @@ And finally, here is a formatter for Javascript. (use-package prettier-js :defer t :straight (:build t) - :hook (rjsx-mode . prettier-js-mode) - :hook (web-mode . prettier-js-mode) - :custom - (prettier-js-args '("--single-quote" - "--jsx-single-quote"))) + :hook ((rjsx-mode web-mode) . prettier-js-mode) + :config + (csetq prettier-js-args '("--single-quote" "--jsx-single-quote"))) #+end_src ***** Typescript