function load_dots set -l options git count $argv | read arg_count if test $arg_count -eq 0 printf "options: " for arg in $options printf "$arg " end printf "\n" end for option in $argv switch "$option" case git load_git case \* printf "error: Unknown option %s\n" $option end end end function load_git envsource ~/.env | while read -l env_var switch $env_var case "GIT_*" # Handle git config variables string lower (string replace -a '_' '.' (string replace -a GIT_ '' $env_var)) | read git_config_key git config --global $git_config_key $$env_var end end git update-index --assume-unchanged .env cat ~/.gitconfig end