#!/usr/bin/env zsh# ── modern.zsh : modern CLI replacements (btop/dust/duf/procs/delta/…) ────────# Each is guarded so a missing binary never errors. Real coreutils stay intact —# we add memorable aliases, we do NOT shadow cat/ps/du/df/top (scripts depend on# the originals). Cheat card: `cheat modern`.# ── bat : syntax-highlighted pager (cat stays the real cat) ──────────────────if(( $+commands[bat])); thenexportBAT_THEME="Rose Pine"aliasb='bat'aliasbcat='bat --style=plain --paging=never'# cat-like, still highlightedaliasbl='bat --style=full'# line numbers + git gutter# colored man pages via batexportMANPAGER="sh -c 'col -bx | bat -l man -p'"exportMANROFFOPT="-c"fi# ── btop : the pretty system monitor ─────────────────────────────────────────if(( $+commands[btop])); thenaliastop='btop'aliashtop='btop'aliasmon='btop'fi# ── dust : disk usage tree (du) ──────────────────────────────────────────────if(( $+commands[dust])); thenaliasdu='dust'aliasdud='dust -d 1'# one level deepaliasdus='command du -sh'# classic summary when you need bytesfi# ── duf : disk free, tabular (df) ────────────────────────────────────────────if(( $+commands[duf])); thenaliasdf='duf'aliasdff='duf --only local'fi# ── procs : modern ps, tree + search ─────────────────────────────────────────if(( $+commands[procs])); thenaliasps='procs'aliaspst='procs --tree' psg(){ procs "$@"}# procs <name> already filtersfi# ── onefetch : repo fetch card (run inside a git repo) ───────────────────────if(( $+commands[onefetch])); thenaliasof='onefetch'aliasofa='onefetch --no-art'fi# ── hyperfine : command benchmarking ─────────────────────────────────────────if(( $+commands[hyperfine])); thenaliasbench='hyperfine'aliasbench3='hyperfine --warmup 3'fi# ── tldr (tealdeer) : fast community man-page examples ────────────────────────if(( $+commands[tldr])); thenaliashelp='tldr'# `??` is a fast way to ask "how do I use X"alias'?'='tldr'fi# ── git delta : better diffs (config lives in ~/.gitconfig) ──────────────────# `dlog`/`dshow` force delta even when piped, handy in scripts.if(( $+commands[delta])); thenaliasgdd='git diff'# already delta via gitconfigaliasgds='git diff --staged'fi# ── terminal toys ────────────────────────────────────────────────────────────(( $+commands[cbonsai]))&&aliasbonsai='cbonsai -l -i -t 0.03'(( $+commands[cmatrix]))&&aliasmatrix='cmatrix -b -u 4'# `rain`/`ring` already exist as crossfetch modes via `cross`.