dotfiles/emacs/.emacs.d/config/init-direnv.el
2021-02-22 09:43:04 -05:00

18 lines
517 B
EmacsLisp

;; Smooth integration with direnv
(use-package direnv
:if (executable-find "direnv")
:defer 2
:config
(direnv-mode)
(add-hook 'eshell-mode-hook #'direnv-update-directory-environment)
(add-hook 'eshell-directory-change-hook
(lambda ()
(unless (file-remote-p default-directory)
(direnv-update-directory-environment))))
(add-hook 'vterm-directory-change-hook
(lambda ()
(unless (file-remote-p default-directory)
(direnv-update-directory-environment)))))
(provide 'init-direnv)