0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Spacemacsでdirenvを使う

Posted at

Spacemacsでcider-jack-inしてそのままREPL上でAPIサーバ立ててしまう言語もあるんだけどなんか環境変数使えてんのかなコレって思ったらどうも素ではdirenvに対応してないらしかった。まあそれはそうか

.spacemacsに設定追加すればいけたので安心した

.spacemacs(抜粋)
...

   dotspacemacs-additional-packages '(direnv)

(defun dotspacemacs/user-config ()

  ;; direnv対応
  (use-package direnv
    :demand t
    :config
    (direnv-mode)
    (setq direnv-always-show-summary nil)
    :hook

  )
)

...

Unfortunately direnv is not integrated in Spacemacs yet, but you can add direnv to dotspacemacs/additional-packages and

(use-package direnv
:demand t
:config
(direnv-mode)
(setq direnv-always-show-summary nil)
:hook
((prog-mode) . direnv-update-environment))

to your dotspacemacs/user-config. Then download direnv binary in directory within your PATH, drop correspondent hook to your shell config, then echo 'layout pipenv' >> .envrc in you project root (where Pipfiles resides) and Voila!

cf. https://gitter.im/syl20bnr/spacemacs?at=5cf2834bff3f016baa88b760

Layer作るならコレみたいな話もあるみたい。

cf. https://github.com/syl20bnr/spacemacs/issues/2294#issuecomment-641484265

先人ありがとナス!てか早くdirenv Layer作って、どうぞ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?