[zsh] add a few useful aliases and functions

This commit is contained in:
Dmytro Meleshko 2020-07-18 22:48:25 +03:00
parent aaab49d57c
commit 3898112521
3 changed files with 14 additions and 1 deletions

View file

@ -2,8 +2,12 @@
# this alias removes leading dollar sign (useful when copying code from Stackoverflow)
alias '$'=''
# this alias allows aliases to work with sudo
# the following aliases allow alias expansion in common programs which take
# commands as their arguments
alias sudo='sudo '
alias watch='watch '
alias xargs='xargs '
alias history='fc -i -l 1'

View file

@ -1,5 +1,6 @@
#!/usr/bin/env zsh
count() { echo "$#"; }
bytecount() { wc -c "$@" | numfmt --to=iec-i; }
@ -72,3 +73,11 @@ git_current_branch() {
)" || return
echo "${ref#refs/heads/}"
}
date-fmt-iso() {
date --utc +'%Y-%m-%dT%H:%M:%SZ' "$@"
}
date-fmt-compact() {
date --utc +'%Y%m%d%H%M%S' "$@"
}