[emacs] use NVM environment installed at nvm-dir <repo>/.nvm

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2021-11-20 15:21:35 +01:00
parent 6b4cad768d
commit 61af147849
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,7 @@
;; Some buffer locals are referencing the project environment: ;; Some buffer locals are referencing the project environment:
;; ;;
;; - prj-root --> <repo>/ ;; - prj-root --> <repo>/
;; - nvm-dir --> <repo>/.nvm
;; - python-environment-directory --> <repo>/local ;; - python-environment-directory --> <repo>/local
;; - python-environment-default-root-name --> py3 ;; - python-environment-default-root-name --> py3
;; - python-shell-virtualenv-root --> <repo>/local/py3 ;; - python-shell-virtualenv-root --> <repo>/local/py3
@ -57,6 +58,9 @@
(setq-local python-environment-directory (setq-local python-environment-directory
(expand-file-name "./local" prj-root)) (expand-file-name "./local" prj-root))
;; to get in use of NVM enviroment, install https://github.com/rejeep/nvm.el
(setq-local nvm-dir (expand-file-name "./.nvm" prj-root))
;; use 'py3' enviroment as default ;; use 'py3' enviroment as default
(setq-local python-environment-default-root-name (setq-local python-environment-default-root-name
"py3") "py3")
@ -90,6 +94,8 @@
(js-mode (js-mode
. ((eval . (progn . ((eval . (progn
;; flycheck should use the (local) NVM environment (see nvm-dir)
(nvm-use-for-buffer)
(setq-local js-indent-level 2) (setq-local js-indent-level 2)
;; flycheck should use the eslint checker from simple theme ;; flycheck should use the eslint checker from simple theme
(setq-local flycheck-javascript-eslint-executable (setq-local flycheck-javascript-eslint-executable