-
-
Save bkono/3457312a9871c779c76535bf647c7c20 to your computer and use it in GitHub Desktop.
elvish direnv integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.elvish/lib/direnv.elv | |
fn hook []{ | |
env = (or (direnv export json | from-json) [&]) | |
if (> (count $env) 0) { | |
f = (mktemp) | |
keys $env | each [k]{ echo "E:"$k" = \""$env[$k]"\"" >> $f } | |
-source $f | |
rm -f $f | |
} | |
} | |
fn setup { | |
edit:before-readline=[ $@edit:before-readline $&hook ] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.elvish/rc.elv | |
use direnv | |
direnv:setup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment