#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/special/abbrev # # originally from: # http://zshwiki.org/home/examples/zleiab typeset -A -g abbrevs abbrevs=("hp" "$WEBPAGE_DS") abbrev-do-expand () { local MBEGIN local MEND local MATCH LBUFFER=${LBUFFER%%(#m)[_a-zA-Z0-9]#} LBUFFER+=${abbrevs[$MATCH]:-$MATCH} zle self-insert } zle -N abbrev-do-expand bindkey "/" abbrev-do-expand