;; Smooth integration with direnv (use-package direnv :if (executable-find "direnv") :defer 2 :init (add-to-list 'auto-mode-alist '("\\.env\\'" . shell-script-mode)) (add-to-list 'auto-mode-alist '("\\.env.local\\'" . shell-script-mode)) :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)))) :custom (direnv-always-show-summary nil)) (provide 'init-direnv)