mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 11:50:38 +01:00
Merge pull request #55 from G33KatWork/full_dir_extend
Add support for three display modes of the path in the prompt: short, medium and long
This commit is contained in:
@@ -170,7 +170,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
|||||||
|`BULLETTRAIN_DIR_BG`|`blue`|Background color
|
|`BULLETTRAIN_DIR_BG`|`blue`|Background color
|
||||||
|`BULLETTRAIN_DIR_FG`|`white`|Foreground color
|
|`BULLETTRAIN_DIR_FG`|`white`|Foreground color
|
||||||
|`BULLETTRAIN_DIR_CONTEXT_SHOW`|`false`|Show user and machine in an SCP formatted style
|
|`BULLETTRAIN_DIR_CONTEXT_SHOW`|`false`|Show user and machine in an SCP formatted style
|
||||||
|`BULLETTRAIN_DIR_EXTENDED`|`true`|Extended path
|
|`BULLETTRAIN_DIR_EXTENDED`|`1`|Extended path (0=short path, 1=medium path, 2=complete path, everything else=medium path)
|
||||||
|
|
||||||
### Git
|
### Git
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ if [ ! -n "${BULLETTRAIN_DIR_CONTEXT_SHOW+1}" ]; then
|
|||||||
BULLETTRAIN_DIR_CONTEXT_SHOW=false
|
BULLETTRAIN_DIR_CONTEXT_SHOW=false
|
||||||
fi
|
fi
|
||||||
if [ ! -n "${BULLETTRAIN_DIR_EXTENDED+1}" ]; then
|
if [ ! -n "${BULLETTRAIN_DIR_EXTENDED+1}" ]; then
|
||||||
BULLETTRAIN_DIR_EXTENDED=true
|
BULLETTRAIN_DIR_EXTENDED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# GIT
|
# GIT
|
||||||
@@ -319,7 +319,18 @@ prompt_dir() {
|
|||||||
local dir=''
|
local dir=''
|
||||||
local _context="$(context)"
|
local _context="$(context)"
|
||||||
[[ $BULLETTRAIN_DIR_CONTEXT_SHOW == true && -n "$_context" ]] && dir="${dir}${_context}:"
|
[[ $BULLETTRAIN_DIR_CONTEXT_SHOW == true && -n "$_context" ]] && dir="${dir}${_context}:"
|
||||||
[[ $BULLETTRAIN_DIR_EXTENDED == true ]] && dir="${dir}%4(c:...:)%3c" || dir="${dir}%1~"
|
|
||||||
|
if [[ $BULLETTRAIN_DIR_EXTENDED == 0 ]]; then
|
||||||
|
#short directories
|
||||||
|
dir="${dir}%1~"
|
||||||
|
elif [[ $BULLETTRAIN_DIR_EXTENDED == 2 ]]; then
|
||||||
|
#long directories
|
||||||
|
dir="${dir}%0~"
|
||||||
|
else
|
||||||
|
#medium directories (default case)
|
||||||
|
dir="${dir}%4(c:...:)%3c"
|
||||||
|
fi
|
||||||
|
|
||||||
prompt_segment $BULLETTRAIN_DIR_BG $BULLETTRAIN_DIR_FG $dir
|
prompt_segment $BULLETTRAIN_DIR_BG $BULLETTRAIN_DIR_FG $dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user