From 459705d05a35c24632aad4122fe4e3d41f6a2f12 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Wed, 25 Dec 2024 19:06:19 -0800 Subject: [PATCH] Random JS changes --- init.el | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/init.el b/init.el index 2cf1178..771b214 100644 --- a/init.el +++ b/init.el @@ -187,18 +187,18 @@ (blueprint "https://github.com/huanie/tree-sitter-blueprint") (kdl "https://github.com/tree-sitter-grammars/tree-sitter-kdl"))) ;; Tree sitter major mode conversions - (setq major-mode-remap-alist - '((c-mode . c-ts-mode) - (c++-mode . c++-ts-mode) - (c-or-c++-mode . c-or-c++-ts-mode) - (python-mode . python-ts-mode) - (java-mode . java-ts-mode) - (rust-mode . rust-ts-mode) - (json-mode . json-ts-mode) - (yaml-mode . yaml-ts-mode) - (css-mode . css-ts-mode) - (js-mode . js-ts-mode) - (cmake-mode . cmake-ts-mode))) + (dolist (ent '((c-mode . c-ts-mode) + (c++-mode . c++-ts-mode) + (c-or-c++-mode . c-or-c++-ts-mode) + (python-mode . python-ts-mode) + (java-mode . java-ts-mode) + (rust-mode . rust-ts-mode) + (json-mode . json-ts-mode) + (yaml-mode . yaml-ts-mode) + (css-mode . css-ts-mode) + (javascript-mode . js-ts-mode) + (cmake-mode . cmake-ts-mode))) + (add-to-list 'major-mode-remap-alist ent)) (defun my/treesit-compile-all (force) "Compile all the modules defined in `treesit-language-source-alist'. If FORCE, recompile all modules, even ones that are already compiled. @@ -1642,6 +1642,11 @@ otherwise, call `bibtex-find-text'." (add-to-list 'eglot-server-programs '(web-mode . ("vscode-html-language-server" "--stdio")))) +;; JavaScript +(use-package js + :ensure nil + :hook (js-ts-mode . eglot-ensure)) + ;; Polymode (use-package polymode :config @@ -2694,7 +2699,7 @@ one of the normal rainbow-delimiters-depth-N-face faces." :hook (dired-mode . my/-maybe-enable-nerd-icons-dired) :init (defun my/-maybe-enable-nerd-icons-dired () - (unless (bound-and-true-p dirvish--this) + (unless (bound-and-true-p dirvish-override-dired-mode) (nerd-icons-dired-mode)))) (use-package kind-icon :after corfu