This commit is contained in:
larstvei 2024-04-24 03:05:00 +02:00
parent ff9cb8ee9f
commit 50221a8857

View File

@ -1166,20 +1166,21 @@
* Direnv * Direnv
I use [[https://direnv.net][direnv]] in combination with [[https://nixos.org][nix]] to allow for programs to only be I use [[https://nixos.org][nix]] in most of my projects, to specify the programs needed in order
available in certain directories. The [[https://github.com/wbolster/emacs-direnv][emacs-direnv]] makes Emacs play nice with work on that project. In combination with [[https://direnv.net][direnv]], these programs are only
direnv, so that it for instance can detect a language server that is only available within those projects; that is: when I =cd= into a Javascript
available within some project. The =direnv-always-show-summary= is set to project, then I can call =npm=, but in my system globally, there is no trace of
=nil= to avoid having long messages pop up in the messages buffer whenever I it. The package [[https://github.com/purcell/envrc][envrc]] helps Emacs and direnv play nice.
enter a directory that interacts with direnv.
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; direnv integration ;; direnv integration
(use-package direnv (use-package envrc
:config :if (executable-find "direnv")
(setq direnv-always-show-summary nil) :init
(direnv-mode 1)) (setq envrc-debug t)
(add-hook 'after-init-hook (lambda () (envrc-global-mode 1))))
#+end_src #+end_src