zsh changes
This commit is contained in:
parent
9e955a6386
commit
4d7bdacb0e
1 changed files with 22 additions and 2 deletions
|
@ -33,6 +33,8 @@ in {
|
|||
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
extended = true;
|
||||
save = 100 * 1000;
|
||||
path = "${config.xdg.dataHome}/zsh_history";
|
||||
};
|
||||
initExtra = ''
|
||||
|
@ -63,13 +65,31 @@ in {
|
|||
|
||||
|
||||
## PROMPT ##
|
||||
function preexec() {
|
||||
timer=$(date +%s%3N)
|
||||
}
|
||||
|
||||
function precmd_timer() {
|
||||
if [ $timer ]; then
|
||||
now=$(date +%s%3N)
|
||||
elapsed=$(($now-$timer))
|
||||
|
||||
if [[ elapsed -gt 100 ]]; then
|
||||
export RPROMPT="%F{cyan}''${elapsed}ms %f"
|
||||
else
|
||||
unset RPROMPT
|
||||
fi
|
||||
unset timer
|
||||
fi
|
||||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
precmd_vcs_info() { vcs_info }
|
||||
precmd_functions+=( precmd_vcs_info )
|
||||
precmd_functions+=( precmd_vcs_info precmd_timer )
|
||||
zstyle ':vcs_info:git:*' formats ' %b '
|
||||
setopt prompt_subst
|
||||
|
||||
PROMPT="%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}\$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f "
|
||||
PROMPT='%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f '
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue