allow prompt to skip expensive display functions conditionally
This commit is contained in:
parent
a4dbf3f519
commit
54c8938a24
1 changed files with 16 additions and 0 deletions
16
nix/home.nix
16
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)"
|
||||
'');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue