From a88d84daec44071696ac73406e8f850f7f2f3258 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 5 Feb 2012 16:08:24 +0100 Subject: [PATCH 1/3] added rehash after apt-get install for enhanced user experience when installing new executables. --- plugins/debian/debian.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 16a5d54ca..c3d358ae6 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -48,7 +48,7 @@ if [[ $use_sudo -eq 1 ]]; then alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" alias afu='sudo apt-file update' alias ag="sudo $apt_pref upgrade" - alias ai="sudo $apt_pref install" + alias ai="sudo $apt_pref install; rehash" alias ap="sudo $apt_pref purge" alias ar="sudo $apt_pref remove" From 180072eead0890dd69b151db2881d2b9721d83bd Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 5 Feb 2012 16:13:43 +0100 Subject: [PATCH 2/3] added personal theme, with remote highlighting etc. Based on robbyrussel's theme, this one shows the time a command took to execute, shows the hostname whenever you're working over ssh, and you get a RED username if working as superuser. Nice stuff. --- themes/marcusmueller.zsh-theme | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 themes/marcusmueller.zsh-theme diff --git a/themes/marcusmueller.zsh-theme b/themes/marcusmueller.zsh-theme new file mode 100644 index 000000000..c14de4874 --- /dev/null +++ b/themes/marcusmueller.zsh-theme @@ -0,0 +1,45 @@ +typeset -F -Z1 SECONDS + +cdpath=( . /home/mueller/bachelor/ /home/mueller/bachelor/code/blocks/ofdm_radar / /home/mueller ) +alias debug="gdb --args" +alias grc="gnuradio-companion" + +note_remind=0 +note_ignore="yes" +note_command="?" +[ -n "$SSH_CLIENT" ] && PROMPT="#%!|%(!.%B%{$fg[red]%}%n@%U%m%u>%{$reset_color%}%b.%{$fg[green]%}%n@%U%m%u>%{$reset_color%})"|| PROMPT="#%!|%(!.%B%{$fg[red]%}%n@%U%m%u>%{$reset_color%}%b.%{$fg[green]%}%n>%{$reset_color%})" +RPROMPT="[%{$fg[green]%}%/%{$reset_color%}]" +function title { + if [[ $TERM == "screen" ]]; then + # Use these two for GNU Screen: + print -nR $'\033k'$1$'\033'\\ + + print -nR $'\033]0;'$2$'\a' + elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then + # Use this one instead for XTerms: + print -nR $'\033]0;'$*$'\a' + fi +} + +function precmd { + title zsh "$PWD" + local -i xx + if [ "x$TTY" != "x" ]; then + if [ "x$note_ignore" = "x" ]; then + note_ignore="yes" + xx=$((($SECONDS-$note_remind)*1000)) + RPROMPT="[%!:%(?.%?.%{$fg[red]%}%B%?%b%{$reset_color%}):${xx}ms:%/]" + fi + fi +} + +function preexec { + emulate -L zsh + local -a cmd; cmd=(${(z)1}) + title $cmd[1]:t "$cmd[2,-1]" + if [ "x$TTY" != "x" ]; then + note_remind="$SECONDS" + note_ignore="" + note_command="$2" + fi +} From 82c89bdd91ea4cc18c7a67363f0b38bfdc8f7186 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 5 Feb 2012 16:36:44 +0100 Subject: [PATCH 3/3] Revert unintended "added rehash after apt-get install", made a mistake, old, not working version, was not meant to be committed, not to speak of being pulled This reverts commit a88d84daec44071696ac73406e8f850f7f2f3258. --- plugins/debian/debian.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index c3d358ae6..16a5d54ca 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -48,7 +48,7 @@ if [[ $use_sudo -eq 1 ]]; then alias adu="sudo $apt_pref update && sudo $apt_pref dist-upgrade" alias afu='sudo apt-file update' alias ag="sudo $apt_pref upgrade" - alias ai="sudo $apt_pref install; rehash" + alias ai="sudo $apt_pref install" alias ap="sudo $apt_pref purge" alias ar="sudo $apt_pref remove"