dotfiles/emacs/.emacs.d/config/init-js.el
2024-10-02 11:17:31 -04:00

41 lines
835 B
EmacsLisp

;; -*- lexical-binding: t; -*-
;; node version manager
(use-package nvm
:straight (:host github :repo "rejeep/nvm.el")
:commands (nvm-use)
:autoload (nvm-use-for
nvm-use-for-buffer
nvm--installed-versions))
(use-package json-mode
:commands (json-mode)
:mode ("\\.json\\'")
:custom
(js-indent-level 2))
(use-package jq-mode
:commands (jq-interactively))
(use-package js
:straight (:type built-in)
:defer t
:custom
(js-indent-level 2))
(use-package js-comint
:commands (run-js)
:config
(js-do-use-nvm)
:general
(js-mode-map "C-c M-j" #'run-js
"C-x C-e" #'js-send-last-sexp
"C-c C-k" #'js-send-buffer
"C-c M-z" #'js-send-buffer-and-go))
(use-package typescript-mode
:custom
(typescript-indent-level 2))
(provide 'init-js)