zsh - Rename selfdefined function -
having precmd() quite lot, checking vcs information, want disable when i'm navigating on slow mounted network drives.
i came next can slow
before changing slow drive , fast
alter back, i'm wondering if there easier?
precmd_slow() { not_much } precmd_fast() { precmd_slow somemore1 somemore2 } precmd() { precmd_fast } slow() { precmd() { precmd_slow } } fast() { precmd() { precmd_fast } }
in add-on precmd
function, there array called precmd
contains list of functions phone call @ same time. can manipulate yourself, zshcontrib
has function add-zsh-hook
simplify matters.
# precmd_slow , precmd_fast defined before autoload add-zsh-hook add-zsh-hook precmd precmd_fast fast () { add-zsh-hook -d precmd precmd_slow add-zsh-hook precmd precmd_fast } slow () { add-zsh-hook -d precmd precmd_fast add-zsh-hook precmd precmd_slow }
zsh function
No comments:
Post a Comment