From 3898112521a8f755bbdadcd5ec6785ae2a8755eb Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sat, 18 Jul 2020 22:48:25 +0300 Subject: [PATCH] [zsh] add a few useful aliases and functions --- nvim/plugin/terminal.vim | 0 zsh/aliases.zsh | 6 +++++- zsh/functions.zsh | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) delete mode 100644 nvim/plugin/terminal.vim diff --git a/nvim/plugin/terminal.vim b/nvim/plugin/terminal.vim deleted file mode 100644 index e69de29..0000000 diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 5f1fe45..d8c4134 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -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' diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 7da6c1a..22bad99 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -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' "$@" +}