dots/files/.zshrc
2026-04-02 17:21:25 +02:00

35 lines
1.2 KiB
Bash

# minimal usable .zshrc, 05feb2013 +leah+
setopt emacs nobeep nonomatch shnullcmd extendedglob \
bashautolist noautomenu noalwayslastprompt
autoload -Uz compinit && compinit
WORDCHARS='*?_-.[]~&;$%^+'
# prompt tweaks, 20jul2017 +leah+
PS1='%B%m%(?.. %??)%(1j. %j&.)%b %2~%B%#%b '
# minimal usable history, 12nov2015 +leah+
setopt histignoredups histignorespace incappendhistory extendedhistory
SAVEHIST=9000 HISTSIZE=9000 HISTFILE=~/.zsh_history
# minimal functions, 08sep2017 +leah+
g() { LC_ALL=C grep --exclude "*~" -r -P ${@:?regexp missing} }
sprunge() { cat $@ | curl -sF 'sprunge=<-' http://sprunge.us }
# minimal functions, 02mar
mkcd() { mkdir -p "$1"; cd "$1" }
ops() { a="$(lr -t 'type=f' -t '!mode|1' -A | fzy)" && "$EDITOR" "$a" }
set -o emacs
alias xi='xi -y'
alias vi='vis'
alias nvi='vis'
alias xr='doas xbps-remove -y'
alias pc='pass -c'
alias pe='pass edit'
alias l='ls -l --color'
cdpath="$HOME"
alias nman='man -M /usr/local/netbsd-man'
mktags() { ctags `lr -t 'name=~".c$"'` }
# date +hostname+ [battery]
printf '%s +%s+ %s\n' \
"$(date +%d%b%Y | tr [:upper:] [:lower:])" "$(hostname)" \
"$((cat /sys/class/power_supply/BAT0/capacity 2>/dev/null && echo %) | tr -d '\n')"