tools/direnv: only run direnv once per buffer

Halves the time direnv integration takes to initialize.
This commit is contained in:
Henrik Lissner 2020-11-10 16:29:13 -05:00
parent 2c663ea5d4
commit d45155aec8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -28,6 +28,13 @@
(file-remote-p default-directory))
(envrc-mode 1))))
;; Ensure these local variables survive major mode changes, so envrc-mode is
;; only "activated" once per buffer.
(put 'envrc-mode 'permanent-local t)
(put 'process-environment 'permanent-local t)
(put 'exec-path 'permanent-local t)
(put 'eshell-path-env 'permanent-local t)
(define-derived-mode +direnv-rc-mode sh-mode "envrc"
"Major mode for .envrc files."
;; Fontify .envrc keywords; it's a good indication of whether or not we've