From 8ce704b45884b1ec317539f63083e8c31e771c05 Mon Sep 17 00:00:00 2001 From: David Chen Date: Mon, 30 Aug 2021 21:46:40 +0800 Subject: [PATCH] added duration-info --- zsh/prompt.zsh | 10 ++++++++++ zsh/zimrc | 1 + zsh/zshrc | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 zsh/prompt.zsh diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh new file mode 100644 index 0000000..30d66d8 --- /dev/null +++ b/zsh/prompt.zsh @@ -0,0 +1,10 @@ +setopt nopromptbang prompt{cr,percent,sp,subst} + +zstyle ':zim:duration-info' threshold 0.5 +zstyle ':zim:duration-info' format '%.4d s' + +autoload -Uz add-zsh-hook +add-zsh-hook preexec duration-info-preexec +add-zsh-hook precmd duration-info-precmd + +RPS1='${duration_info}%' diff --git a/zsh/zimrc b/zsh/zimrc index 783a554..c8d7893 100644 --- a/zsh/zimrc +++ b/zsh/zimrc @@ -5,6 +5,7 @@ zmodule termtitle zmodule utility zmodule completion zmodule git-info +zmodule duration-info zmodule prompt-pwd zmodule magicmace zmodule zsh-users/zsh-completions diff --git a/zsh/zshrc b/zsh/zshrc index 38a29f2..7e96646 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -12,4 +12,4 @@ fi autopair-init source ~/.zim/modules/fzf-tab/fzf-tab.plugin.zsh - +source ~/.config/zsh/prompt.zsh