dotfiles/emacs/.emacs.d/config/init-direnv.el

23 lines
712 B
EmacsLisp
Raw Normal View History

2021-02-21 13:40:47 +00:00
;; Smooth integration with direnv
(use-package direnv
:if (executable-find "direnv")
:defer 2
2021-03-09 15:26:04 +00:00
:init
(add-to-list 'auto-mode-alist '("\\.env\\'" . shell-script-mode))
(add-to-list 'auto-mode-alist '("\\.env.local\\'" . shell-script-mode))
2021-02-21 13:40:47 +00:00
:config
(direnv-mode)
(add-hook 'eshell-mode-hook #'direnv-update-directory-environment)
(add-hook 'eshell-directory-change-hook
2021-02-22 14:43:04 +00:00
(lambda ()
(unless (file-remote-p default-directory)
(direnv-update-directory-environment))))
(add-hook 'vterm-directory-change-hook
2021-02-21 13:40:47 +00:00
(lambda ()
(unless (file-remote-p default-directory)
(direnv-update-directory-environment))))
:custom
(direnv-always-show-summary nil))
2021-02-21 13:40:47 +00:00
(provide 'init-direnv)