X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=.zsh_functions;h=abc9d22e4507617937982138071b2fc36d2e7391;hb=db4053626e7a6b01dda64ab65d157872f56c0b51;hp=858e7c5972148d85224c21eda440f382829b5e7d;hpb=bacbcecaa0bce6e2286cb1c031131149b7130a46;p=user%2Fhenk%2Fvcsh%2Fzsh.git diff --git a/.zsh_functions b/.zsh_functions index 858e7c5..abc9d22 100644 --- a/.zsh_functions +++ b/.zsh_functions @@ -1,58 +1,78 @@ -function info_print () { - local esc_begin esc_end - esc_begin="$1" - esc_end="$2" - shift 2 - printf '%s' ${esc_begin} - printf '%s' "$*" - printf '%s' "${esc_end}" -} - -function set_title () { - info_print $'\e]0;' $'\a' "$@" -} - -function ESC_print () { - info_print $'\ek' $'\e\\' "$@" -} +#function info_print () { +# local esc_begin esc_end +# esc_begin="$1" +# esc_end="$2" +# shift 2 +# printf '%s' ${esc_begin} +# printf '%s' "$*" +# printf '%s' "${esc_end}" +#} +# +#function set_title () { +# info_print $'\e]0;' $'\a' "$@" +#} +# +#function ESC_print () { +# info_print $'\ek' $'\e\\' "$@" +#} +# +#preexec () { +# case $TERM in +# (xterm*|rxvt*) +# set_title "${(%):-"%n@%m:"}" "$1" +# ;; +# (screen*) +# local CMD=${1[(wr)^(*=*|sudo|ssh|evince|-*)]} +# ESC_print ${CMD} +# ;; +# esac +#} +# +#precmd () { +# case $TERM in +# (xterm*|rxvt*) +# set_title ${(%):-"%n@%m: %~"} +# ;; +# (screen*) +# ESC_print "zsh" +# ;; +# esac +# +# vcs_info +# +## local INBOXINFO="$(task rc.gc=off rc.verbose=nothing +in +PENDING count) " +# +# PS1="${HENKSPROMPTHEADER}%(0?..%F{red}E%?%f )%(1j.%F{yellow}J%j%f .)%(3L.%F{yellow}L%L%f .)%3~ %F{green}$VCSH_REPO_NAME%f%F{yellow}${vcs_info_msg_0_}%f%# " +#} -preexec () { - case $TERM in - (xterm*|rxvt*) - set_title "${(%):-"%n@%m:"}" "$1" - ;; - (screen*) - local CMD=${1[(wr)^(*=*|sudo|ssh|evince|-*)]} - ESC_print ${CMD} - ;; - esac +function vifind () { + vi $( find $@) } -precmd () { - case $TERM in - (xterm*|rxvt*) - set_title ${(%):-"%n@%m: %~"} - ;; - (screen*) - ESC_print "zsh" - ;; - esac - - vcs_info - if [[ -n ${vcs_info_msg_0_} ]]; then - local HENKSPROMPT="%(0?..%F{red}E%?%f )%(1j.%F{yellow}J%j%f .)%(3L.%F{yellow}L%L%f .)%3~ %F{green}$VCSH_REPO_NAME%f%F{yellow}${vcs_info_msg_0_}%f%# " - PS1="$HENKSPROMPTHEADER$HENKSPROMPT" - else - local HENKSPROMPT="%(0?..%F{red}E%?%f )%(1j.%F{yellow}J%j%f .)%(3L.%F{yellow}L%L%f .)%3~ %F{green}$VCSH_REPO_NAME%f%F{yellow}${vcs_info_msg_0_}%f%# " - PS1="$HENKSPROMPTHEADER$HENKSPROMPT" - fi +function new_haskell_project () { + stack new $1 simple + cd $1 + git init } -function vifind () { - vi $( find $1 -type f ) +function henkspngpostproc () { + local resize_by + local img + resize_by="$1" + shift + for img in $* + do + mkdir -p resized/pngnqed + convert -resize $resize_by% $img resized/$img + pngnq -f -d resized/pngnqed -e .png resized/$img + done } -function shufflevideos () { - find $@ -type f -iregex ".*\.\(avi\|flv\|mkv\|mpeg\|mpg\|wmv\|wva\|mp4\|webm\|wva\|m4v\|ogm\|mp4\|mov\)" -exec mpv --shuffle $MPVOPTS \{\} + +function with () { + local prefix="$* " str compcontext=normal:normal:_normal + while : + do + str=$prefix + vared str && eval $str + done } -