From c4acd38936aeaa2fb352c14e94f97d7249c6ec6b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 15 Aug 2024 15:45:38 +0100 Subject: (Emacs/config)+js-mode configuration Having to use JS in my Emacs means disabling a few things. --- Emacs/.config/emacs/config.org | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 70e1606..db56299 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -2222,7 +2222,8 @@ limit), so set it for specific modes need the help. "w" #'whitespace-mode) :hook (before-save-hook . whitespace-cleanup) - ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook org-mode-hook text-mode-hook) + ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook + org-mode-hook text-mode-hook js-mode-hook) . whitespace-mode) :init (setq whitespace-line-column nil @@ -2243,7 +2244,7 @@ use 70 fill columns while code should stick to 80. :hook (text-mode-hook . auto-fill-mode) ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook - org-mode-hook text-mode-hook) + org-mode-hook text-mode-hook js-mode-hook) . display-fill-column-indicator-mode)) #+end_src ** Show-paren-mode @@ -2460,7 +2461,7 @@ description I give won't do it justice. :config (add-multiple-to-list aggressive-indent-excluded-modes 'c-mode 'c++-mode 'cc-mode - 'asm-mode) + 'asm-mode 'js-mode) (global-aggressive-indent-mode)) #+end_src ** Compilation @@ -3551,7 +3552,6 @@ Firstly, web mode for consistent colouring of syntax. :straight t :defer t :mode ("\\.html" . web-mode) - :mode ("\\.js" . web-mode) :mode ("\\.css" . web-mode) :custom ((web-mode-code-indent-offset 2) @@ -3606,6 +3606,17 @@ Emmet for super speed code writing. " ")) #+end_src +*** Javascript Mode +A better mode for JavaScript that also has automatic integration with +eglot. +#+begin_src emacs-lisp +(use-package js + :mode ("\\.js" . js-mode) + :hook + (js-mode-hook . auto-fill-mode) + :init + (setq js-indent-level 2)) +#+end_src *** WAIT Typescript :PROPERTIES: :header-args:emacs-lisp: :tangle no -- cgit v1.2.3-13-gbd6f