add some new functions
This commit is contained in:
parent
c0a66f617a
commit
0cadf4111a
3 changed files with 25 additions and 0 deletions
3
home/private_dot_config/zsh/functions/mv-no-spaces
Normal file
3
home/private_dot_config/zsh/functions/mv-no-spaces
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
mv -i "$1" "${1// /}"
|
18
home/private_dot_config/zsh/functions/scratch
Normal file
18
home/private_dot_config/zsh/functions/scratch
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
##? drop into a directory in ~/scratch/%Y/%U
|
||||||
|
|
||||||
|
# inspo: https://leahneukirchen.org/blog/archive/2006/01/keeping-your-home-clean-with-mess.html
|
||||||
|
|
||||||
|
date_dir=$(date +"%Y/%U")
|
||||||
|
DATED_SCRATCH=$HOME/scratch/$date_dir
|
||||||
|
mkdir -p $DATED_SCRATCH
|
||||||
|
ln -sfn $DATED_SCRATCH $HOME/scratch/current
|
||||||
|
|
||||||
|
if [[ -n $1 ]]; then
|
||||||
|
DIR=$DATED_SCRATCH/$1
|
||||||
|
mkdir -p $DIR
|
||||||
|
else
|
||||||
|
DIR=$(mktemp -d $DATED_SCRATCH/$(date +"%d").XXXX)
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $DIR
|
4
home/private_dot_config/zsh/functions/t
Normal file
4
home/private_dot_config/zsh/functions/t
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
##? drop into a temporary directory
|
||||||
|
|
||||||
|
pushd $(mktemp -d /tmp/${1:+$1.}XXXX)
|
Loading…
Add table
Reference in a new issue