From f390f01c67b92b4c4f520e8c64fc518beb235f90 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Mon, 29 Jan 2024 14:32:38 +0530 Subject: Probally Should update more often --- .zfunc/prompt_marc_setup | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .zfunc/prompt_marc_setup (limited to '.zfunc/prompt_marc_setup') diff --git a/.zfunc/prompt_marc_setup b/.zfunc/prompt_marc_setup new file mode 100644 index 0000000..834b233 --- /dev/null +++ b/.zfunc/prompt_marc_setup @@ -0,0 +1,28 @@ +#!zsh +emulate -L zsh + +prompt_marc_precmd() { + vcs_info + RPS1="%B$vcs_info_msg_0_%b" + set-title "$(print -Pn "%n@%m %~")" +} + +prompt_marc_preexec() { + set-title "$(print -Pn "%n@%m %~ %# ")${1}" +} + +prompt_marc_setup () { + autoload -Uz vcs_info set-title + add-zsh-hook precmd prompt_marc_precmd + add-zsh-hook preexec prompt_marc_preexec + + zstyle ':vcs_info:*' check-for-changes true + zstyle ':vcs_info:*' get-revision true + zstyle ':vcs_info:*' formats "%s:%R|%S@%b %m%u%c" + zstyle ':vcs_info:*' actionformats "%s:%r|%S@%b (%a) %m%u%c" + + prompt_opts=( ) + PS1='%B%? %n@%M:%~ %# %b' +} + +prompt_marc_setup "$@" -- cgit v1.2.3-70-g09d2