Fixed vim and zsh
This commit is contained in:
13
zsh/modules/prompt/functions/short_pwd
Normal file
13
zsh/modules/prompt/functions/short_pwd
Normal file
@ -0,0 +1,13 @@
|
||||
# shortens the pwd for use in prompt
|
||||
|
||||
local current_dir="${1:-${PWD}}"
|
||||
local return_dir='~'
|
||||
|
||||
current_dir="${current_dir/#${HOME}/~}"
|
||||
|
||||
# if we aren't in ~
|
||||
if [[ ${current_dir} != '~' ]]; then
|
||||
return_dir="${${${${(@j:/:M)${(@s:/:)current_dir}##.#?}:h}%/}//\%/%%}/${${current_dir:t}//\%/%%}"
|
||||
fi
|
||||
|
||||
print ${return_dir}
|
Reference in New Issue
Block a user