A while ago I made a tiny function in my ~/.zshrc to download a video from the link in my clipboard. I use this nearly every day to share videos with people without forcing them to watch it on whatever site I found it. What’s a script/alias that you use a lot?
# Download clipboard to tmp with yt-dlp
tmpv() {
cd /tmp/ && yt-dlp "$(wl-paste)"
}
For doing stuff in a directory, I use a replacement for
cd
command.For aliases:
alias +='git add' alias +p='git add -p' alias +u='git add -u' alias -- -='cd -' alias @='for i in' alias c='cargo' alias date='LANG=C date' alias diff='cdiff' alias gg='git grep -n' alias grep='grep --color=auto' alias ll='ls -o' alias ls='ls -vFT0 --si --color=auto --time-style=long-iso' alias rmd='rmdir'
I also have various small scripts and functions:
a
for package management (thinkapt
but has simplified arguments which makes it faster to use in usual cases),e
for opening file in Emacs,g
forgit
,s
forsudo
.And here’s
,
:$ cat ~/.local/bin/, #!/bin/sh if [ $# -eq 0 ]; then paste -sd, else printf '%s\n' "$@" | paste -sd, fi