2021-02-26 15:28:33 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; node version manager
|
|
|
|
(use-package nvm
|
|
|
|
:commands (nvm-use
|
|
|
|
nvm-use-for
|
2021-04-05 14:44:49 +00:00
|
|
|
nvm-use-for-buffer
|
|
|
|
nvm--installed-versions)
|
|
|
|
:init
|
|
|
|
(defun nvm (version)
|
|
|
|
(interactive (list
|
|
|
|
(completing-read "Node version: "
|
|
|
|
(mapcar #'car
|
|
|
|
(nvm--installed-versions)))))
|
|
|
|
(nvm-use version)))
|
|
|
|
|
2022-08-17 15:17:33 +00:00
|
|
|
(use-package json-mode
|
|
|
|
:commands (json-mode)
|
2022-11-04 14:23:29 +00:00
|
|
|
:mode ("\\.json\\'")
|
|
|
|
:custom
|
|
|
|
(js-indent-level 2))
|
2022-08-17 15:17:33 +00:00
|
|
|
|
2022-09-01 19:11:15 +00:00
|
|
|
(use-package jq-mode
|
|
|
|
:commands (jq-interactively))
|
|
|
|
|
2021-04-05 14:44:49 +00:00
|
|
|
(use-package js
|
|
|
|
:straight (:type built-in)
|
|
|
|
:defer t
|
2022-11-04 14:23:29 +00:00
|
|
|
:custom
|
|
|
|
(js-indent-level 2))
|
2021-04-05 14:44:49 +00:00
|
|
|
|
|
|
|
(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))
|
2021-02-26 15:28:33 +00:00
|
|
|
|
2023-03-30 13:37:46 +00:00
|
|
|
(use-package typescript-mode
|
|
|
|
:custom
|
|
|
|
(typescript-indent-level 2))
|
|
|
|
|
2021-02-26 15:28:33 +00:00
|
|
|
(provide 'init-js)
|