#!/bin/sh
# vim: ft=sh:sw=2:ts=2:sts=2:fdm=marker:fdl=0:noml:

silent='>/dev/null 2>&1 &'
detach='>/dev/null 2>&1 &'


JL="cut -d{ -f2-|sed 's|^|{|'"
C='| xsel -b --trim'

:n='>/dev/null'
:nn='&>/dev/null'
:bg='&>/dev/null &!'
:h='--help 2>&1 | bat -pl help'

B="| xargs bat"
X="| xargs -d '\n' -L 1"
X1="| xargs -d '\n' -n 1"
XC="| xclip -selection clipboard"
L="--color=always | ${PAGER:-less}"
T=" | tree -C --fromfile . | less -F"

isotime='$(date -u -Iseconds)'
timefile() {
  printf '%s%s' "$(date -Iseconds)" ".$1"
}
nnote='$(timefile md)'
todaynote='"$(date -u +%Y-%m-%d)"*'
detch='&>/dev/null 2>/dev/null & disown'
pagit='| $PAGER'
w3m-htm='| w3m -T text/html'
if command -v lolcat >/dev/null; then
  rofl='| lolcat'
fi
alias zpstudy='zpmod source-study | grep -v "[0-5] ms" | sort -bgr'
'wlp'='"$(wl-paste -n)"'

VV=' |& vim +S -'            # Global aliases to pipe output.
LL=' |& less'
LLl=' |& less'               # Typo after using ^l
LLS=' |& less -S'            # No wrapping.
GG=' |& grep'
HH=' |& head -n20'
SS=' |& sort'
SSH=' |& sort -h'
CC=' |& xclip -in'
# TODO: ideally I'd like to copy to both, but xclip doesn't support that

B="| xargs bat"
G="| grp"
X="| xargs -d '\n' -L 1"
X1="| xargs -d '\n' -n 1"
XC="| xclip -selection clipboard"
L="--color=always | ${PAGER:-less}"
T=" | tree -C --fromfile . | less -F"
