mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-18 01:29:06 +00:00
feat: strip-home fn
This commit is contained in:
@@ -451,7 +451,18 @@ disable_touchid_sudo() {
|
||||
popd
|
||||
}
|
||||
|
||||
strip-home() {
|
||||
repl="~"
|
||||
if [[ "$1" == "-e" ]]; then
|
||||
repl=""
|
||||
shift
|
||||
fi
|
||||
dir="$1"
|
||||
echo ${dir/$HOME/$repl}
|
||||
}
|
||||
|
||||
# select random element from arguments
|
||||
# always keep last, breaks syntax highlighting
|
||||
randarg() {
|
||||
echo "${${@}[$RANDOM % $# + 1]}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user