]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/blobdiff - .zsh_functions
Add config for title-plugin for tmux, vim, zsh
[user/henk/vcsh/zsh.git] / .zsh_functions
index 18aa5e32cfb633ea3b4581d74b4763e0b5393e29..abc9d22e4507617937982138071b2fc36d2e7391 100644 (file)
@@ -1,49 +1,49 @@
-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}${INBOXINFO}%(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%# "
-}
+#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%# "
+#}
 
 function vifind () {
     vi $( find $@)
@@ -54,3 +54,25 @@ function new_haskell_project () {
     cd $1
     git init
 }
+
+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 with () {
+    local prefix="$* " str compcontext=normal:normal:_normal
+    while :
+    do
+      str=$prefix
+      vared str && eval $str
+    done
+}