diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-02-14 04:21:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-14 04:21:33 +0300 |
commit | 36d74f34c27e77969eba205333f10a85aba4fffd (patch) | |
tree | 4dda4b6768422aae2b402b21815cb9ddad05f4e4 /functions | |
parent | b6e55c189e6a7958164304cf5ffd7766ffe8f3bf (diff) | |
parent | 221030013e93e6fcde44b8a6c656db9139c142c9 (diff) |
Merge branch 'next' into dir_first_character
Diffstat (limited to 'functions')
-rw-r--r-- | functions/icons.zsh | 3 | ||||
-rw-r--r-- | functions/utilities.zsh | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/functions/icons.zsh b/functions/icons.zsh index df92d22a..44d99095 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -78,6 +78,7 @@ case $POWERLEVEL9K_MODE in PYTHON_ICON $'\U1F40D' # 🐍 SWIFT_ICON '' PUBLIC_IP_ICON '' + LOCK_ICON $'\UE138' # ) ;; 'awesome-fontconfig') @@ -138,6 +139,7 @@ case $POWERLEVEL9K_MODE in PYTHON_ICON $'\U1F40D' # 🐍 SWIFT_ICON '' PUBLIC_IP_ICON '' + LOCK_ICON $'\UE138' # ) ;; *) @@ -198,6 +200,7 @@ case $POWERLEVEL9K_MODE in PYTHON_ICON '' SWIFT_ICON 'Swift' PUBLIC_IP_ICON '' + LOCK_ICON $'\UE0A2' ) ;; esac diff --git a/functions/utilities.zsh b/functions/utilities.zsh index f27c7f99..22b53c6a 100644 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -208,3 +208,19 @@ 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 [[ "$PWD" == "$HOME" || "$PWD" == "/" ]]; then + echo "$PWD" + elif test -e "$1"; then + pushd .. > /dev/null + upsearch "$1" + popd > /dev/null + echo "$PWD" + else + pushd .. > /dev/null + upsearch "$1" + popd > /dev/null + fi +} |