--- /gnu/store/2hsg15n644f0glrcbkb1kqknmmqdar03-zsh-5.8/share/zsh/5.8/functions/sticky-note 1970-01-01 01:00:01.000000000 +0100 +++ /home/ben/.oh-my-zsh/custom/autoload/sticky-note 2021-05-02 23:45:17.021881434 +0100 @@ -49,7 +49,7 @@ # I encourage all you creative people to contribute enhancements ... emulate -LR zsh -setopt nobanghist extendedhistory histignoredups +setopt nobanghist extendedhistory histignoredups noflowcontrol extendedglob local STICKYFILE=${STICKYFILE:-$HOME/.zsticky} local STICKYSIZE=${STICKYSIZE:-1000} @@ -72,19 +72,47 @@ bindkey -M sticky-vicmd ZZ accept-line fi -[[ "$1" == -b ]] && return 0 +if [[ "$*" == *-h* ]]; then + print "Usage: sticky-note [OPTION]... +Where [OPTION]s can be: + + -h display this help and exit + -l list existing sticky notes + -b install keymaps & keybindings, and exit + -c COL make sticky note a certain colour (ignored with -l option) + -B make sticky note blink (ignored with -l option) + +With no option a new sticky note is prompted for, with colour specified +by the \"theme\" zstyle for the \":sticky-note\" context" + return 0 +fi + +[[ "$1" == *-b* ]] && return 0 # Look up color theme local -A theme (($+bg && $+fg)) || { autoload -Uz colors; colors } + zstyle -m :sticky-note theme '*' || { zstyle :sticky-note theme bg yellow fg black } zstyle -a :sticky-note theme theme -(( ${+bg[$theme[bg]]} )) && theme[bg]=$bg[$theme[bg]] (( ${+fg[$theme[fg]]} )) && theme[fg]=$fg[$theme[fg]] +(( ${+bg[$theme[bg]]} )) && theme[bg]=$bg[$theme[bg]] (( ${+theme[color]} )) || theme[color]=$theme[bg]$theme[fg] (( ${+theme[reset]} )) || theme[reset]=$reset_color +# If -c