trimmed some stuff and reorganized the dotfiles
This commit is contained in:
parent
3f5e822fb3
commit
5024639019
28 changed files with 375 additions and 174 deletions
19
config/zsh/zshrc.d/aliases.zsh
Normal file
19
config/zsh/zshrc.d/aliases.zsh
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Interactive
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
||||
# Listing
|
||||
alias l='ls -lh' #size,show type,human readable
|
||||
alias la='ls -lAh' #long list,show almost all,show type,human readable
|
||||
alias lr='ls -tRh' #sorted by date,recursive,show type,human readable
|
||||
alias lt='ls -lth' #long list,sorted by date,show type,human readable
|
||||
|
||||
# The Fuck
|
||||
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
|
||||
|
||||
# PClear
|
||||
clearall () { clear; printf '\033[3J' }
|
||||
|
||||
# Make Dir and enter it
|
||||
mkcd() { mkdir $1 &>/dev/null; [ -e $1 ] && cd $1 }
|
54
config/zsh/zshrc.d/transfer.zsh
Normal file
54
config/zsh/zshrc.d/transfer.zsh
Normal file
|
@ -0,0 +1,54 @@
|
|||
#
|
||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||
#
|
||||
# Authors:
|
||||
# Remco Verhoef <remco@dutchcoders.io>
|
||||
#
|
||||
|
||||
transfer() {
|
||||
# check arguments
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# get temporarily filename, output is written to this file show progress can be showed
|
||||
tmpfile=$( mktemp -t transferXXX )
|
||||
|
||||
# upload stdin or file
|
||||
file=$1
|
||||
|
||||
if tty -s;
|
||||
then
|
||||
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||
|
||||
if [ ! -e $file ];
|
||||
then
|
||||
echo "File $file doesn't exists."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -d $file ];
|
||||
then
|
||||
# zip directory and transfer
|
||||
zipfile=$( mktemp -t transferXXX.zip )
|
||||
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
|
||||
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
|
||||
rm -f $zipfile
|
||||
else
|
||||
# transfer file
|
||||
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
|
||||
fi
|
||||
else
|
||||
# transfer pipe
|
||||
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
|
||||
fi
|
||||
|
||||
# cat output link
|
||||
cat $tmpfile
|
||||
|
||||
# cleanup
|
||||
rm -f $tmpfile
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue