Add dir_truncate_root option
This commit is contained in:
parent
a58e8bdc8c
commit
ebf808c533
2 changed files with 30 additions and 2 deletions
|
@ -208,3 +208,18 @@ function truncatePathFromRight() {
|
|||
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \
|
||||
"s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g"
|
||||
}
|
||||
|
||||
# Search recursively in parent folders for given file.
|
||||
function upsearch () {
|
||||
if test -e "$1"; then
|
||||
echo "$PWD"
|
||||
else
|
||||
if [[ "$PWD" == "/" || "$PWD" == "$HOME" ]]; then
|
||||
echo "$PWD";
|
||||
else
|
||||
pushd .. > /dev/null
|
||||
upsearch "$1"
|
||||
popd > /dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue