Last active
March 8, 2018 05:32
-
-
Save thomasritz/d2290fc8197b44cbddf0f9b1ca1b01b2 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