legacy-dotfiles/zsh/.zsh/functions/shorten-dir

7 lines
128 B
Text
Raw Normal View History

2014-07-01 22:53:27 +02:00
# -*- mode: sh; -*-
autoload -U regexp-replace
local curdir=$1
regexp-replace curdir '(\.?[^./])[^/]+/' '$match/'
echo $curdir