mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-02 03:59:25 +00:00
Move common promptpwd code to external function
This commit is contained in:
committed by
Kaleb Elwert
parent
b963484fe7
commit
60c433d4ce
@ -11,23 +11,12 @@
|
||||
# Load dependencies.
|
||||
pmodload 'helper'
|
||||
|
||||
function prompt_damoekri_pwd {
|
||||
local pwd="${PWD/#$HOME/~}"
|
||||
|
||||
if [[ "$pwd" == (#m)[/~] ]]; then
|
||||
_prompt_damoekri_pwd="$MATCH"
|
||||
unset MATCH
|
||||
else
|
||||
_prompt_damoekri_pwd="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}"
|
||||
fi
|
||||
}
|
||||
|
||||
function prompt_damoekri_precmd {
|
||||
prompt_damoekri_precmd() {
|
||||
setopt LOCAL_OPTIONS
|
||||
unsetopt XTRACE KSH_ARRAYS
|
||||
|
||||
# Format PWD.
|
||||
prompt_damoekri_pwd
|
||||
_prompt_damoekri_pwd=$(promptpwd)
|
||||
|
||||
# Get Git repository information.
|
||||
if (( $+functions[git-info] )); then
|
||||
|
Reference in New Issue
Block a user