diff options
author | Adam Hovorka <[email protected]> | 2017-08-07 13:58:15 -0600 |
---|---|---|
committer | Adam Hovorka <[email protected]> | 2017-08-07 13:58:15 -0600 |
commit | e69b853c9bc274f61bb2f58800612678fe287f9a (patch) | |
tree | 4d16a12f2193e2a9d2f89daebfb8b368fb94162c /base/.zsh/functions.zsh | |
parent | f2391b8f1552965b81ec1f39d351f810dd591858 (diff) |
Add misc aliases and functions
Diffstat (limited to 'base/.zsh/functions.zsh')
-rw-r--r-- | base/.zsh/functions.zsh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/base/.zsh/functions.zsh b/base/.zsh/functions.zsh index 7c405f0..4606c13 100644 --- a/base/.zsh/functions.zsh +++ b/base/.zsh/functions.zsh @@ -1,10 +1,18 @@ -todo () { +function todo { a="" for i; do a="$a,$i"; done a="{$(echo "$a" | cut -d',' -f2-)}" echo "grep -R --exclude-dir=$a TODO | sed -e 's/.*TODO //;s/ \*\/$//;s/ -->//' | LC_ALL=C sort -u" | zsh } -which () { +function which { (alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@ } #export -f which + +function trash { + mkdir "$HOME/.trash" + for file in "$@"; do + mv "$file" "$HOME/.trash/$(basename $file).$(date +%Y%m%d-%H%M%S)" + done +} # Add this to your crontab: +# 43 0 * * 3 find ~/.trash -type f -mtime +90 -delete |