summaryrefslogtreecommitdiff
path: root/lisp/web.el
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2022-09-05 13:09:22 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2022-09-05 13:09:22 -0400
commitad7f668eda2b496f8579ce388fa45dac3b482489 (patch)
tree6cc45d136e93d7fbd1a27f68ee350e56b2020d6b /lisp/web.el
parent6257322d751dc36eaaf509682da164f6aef3ff90 (diff)
Some general improvements for web mode, need to test them out on a real project though
Diffstat (limited to 'lisp/web.el')
-rw-r--r--lisp/web.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/web.el b/lisp/web.el
index ae8f96c..cf78b7e 100644
--- a/lisp/web.el
+++ b/lisp/web.el
@@ -37,17 +37,32 @@
)
(add-hook 'js2-mode-hook 'my-js2-mode-hook)
(add-hook 'js2-mode-hook 'eglot-ensure)
+(add-hook 'js2-mode-hook #'smartparens-mode)
(push '("\\.js[x]?\\'" . js2-mode) auto-mode-alist)
+(define-key js2-mode-map (kbd "M-.") nil)
+(add-hook 'js2-mode-hook (lambda ()
+ (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))
+(setq js2-highlight-level 3)
+(setq js2-idle-timer-delay 0.1)
;; JS2-Refactor
(use-package js2-refactor)
(add-hook 'js2-mode-hook #'js2-refactor-mode)
-(js2r-add-keybindings-with-prefix "C-c C-r")
+(defun keybind-setup()
+ "Set up the keybinds."
+ (local-set-key [f2] 'js2r-rename-var)
+)
+(add-hook 'js2-mode-hook 'keybind-setup)
;; Web goodies
(autoload 'json-mode "json-mode"
"Use the json-mode package to provide 'json-mode on-demand."
t)
+;; Ignore certain directories in projectile
+(with-eval-after-load 'projectile
+ (add-to-list 'projectile-globally-ignored-directories "node_modules")
+ (add-to-list 'projectile-project-root-files "package.json"))
+
(provide 'web)
;;; web.el ends here