From 2afa8e43ae44ccbd8e496e4aeb77b0113dd2d5af Mon Sep 17 00:00:00 2001 From: Zoey Llewellyn Hewll Date: Sun, 1 Oct 2017 12:03:45 +0800 Subject: [PATCH] Add pwd-length option 'tail' This option makes `prompt-pwd` only show the last directory in the path, for minimalist prompts --- modules/prompt/functions/prompt-pwd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/prompt/functions/prompt-pwd b/modules/prompt/functions/prompt-pwd index ebab583a..121fd942 100644 --- a/modules/prompt/functions/prompt-pwd +++ b/modules/prompt/functions/prompt-pwd @@ -19,6 +19,8 @@ elif [[ "$current_pwd" == (#m)[/~] ]]; then unset MATCH elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then ret_directory=${current_pwd} +elif zstyle -m ':prezto:module:prompt' pwd-length 'tail'; then + ret_directory=${current_pwd:t} else ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}" fi