diff --git a/nix/home.nix b/nix/home.nix index e07495a..89baf11 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -103,6 +103,22 @@ in { bindkey '^[[B' history-substring-search-down bindkey -M viins 'jj' vi-cmd-mode + # utility for storing functions under a new name + save_function() { + local ORIG_FUNC=$(declare -f $1) + local NEWNAME_FUNC="$2''${ORIG_FUNC#$1}" + eval "$NEWNAME_FUNC" + } + + # Override an oh-my-zsh/lib/git.sh function so that old repositories + # don't slow the shell down + save_function git_prompt_status old_git_prompt_status + function git_prompt_status() { + if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then + old_git_prompt_status + fi + } + eval "$(direnv hook zsh)" '');