mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] add a few useful aliases and functions
This commit is contained in:
parent
aaab49d57c
commit
3898112521
3 changed files with 14 additions and 1 deletions
|
@ -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'
|
||||
|
||||
|
|
|
@ -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' "$@"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue