diff options
-rw-r--r-- | .zlogin | 2 | ||||
-rw-r--r-- | 01_Internal.zsh | 18 | ||||
-rw-r--r-- | 10_Environment.zsh | 2 | ||||
-rw-r--r-- | 11_Colors.zsh | 2 | ||||
-rw-r--r-- | 12_Prompts.zsh | 46 | ||||
-rw-r--r-- | 13_ZshHighlight.zsh | 1 | ||||
-rw-r--r-- | net:anevia.com/user:hhiegel/Aliases.zsh | 3 | ||||
-rw-r--r-- | net:anevia.com/user:hhiegel/Colors.zsh | 10 | ||||
-rw-r--r-- | net:anevia.com/user:hhiegel/Environment.zsh | 1 | ||||
-rw-r--r-- | net:anevia.com/user:hhiegel/Functions.zsh | 23 | ||||
-rw-r--r-- | net:anevia.com/user:hhiegel/Prompts.zsh | 12 | ||||
l--------- | net:anevia.com/user:hugues | 1 | ||||
m--------- | zsh-syntax-highlighting | 0 |
13 files changed, 90 insertions, 31 deletions
@@ -1,5 +1,5 @@ -__cmd_exists keychain && eval $(keychain --eval --inherit any-once --quick) +__cmd_exists keychain && eval $(keychain) __cmd_exists when && when diff --git a/01_Internal.zsh b/01_Internal.zsh index 217b013..20c02c3 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -196,6 +196,7 @@ __get_git_branch () # Get current working GIT branch my_git_branch="$(git symbolic-ref --short -q HEAD)" + #my_git_branch="$(git name-rev --name-only HEAD)" # for future use checkouted_branch=$my_git_branch @@ -366,7 +367,8 @@ __get_git_tracking_status() { svn_current=$(git svn find-rev HEAD 2>/dev/null) # Finds any reference upwards current HEAD, and get the latest possible git-svn-id - svn_track=$(git log --grep git-svn-id -1 --pretty=%h $(git branch -a --contains=HEAD | cut -c3-) -- ) + #svn_track=$(git log --grep git-svn-id -1 --pretty=%h $(git branch -a --contains=HEAD | cut -c3-) -- ) + svn_track=$(git log --grep git-svn-id -1 --pretty=%h HEAD) svn_rev=$(git svn find-rev $svn_track) # eval $( git svn info | awk '/^URL: / { print "svn_url="$2 } # /^Repository UUID: / { print "svn_repo="$3 } @@ -683,12 +685,24 @@ zle -N _rehash # Process helper _process_tree() { + FULLCMD=0 + if [ "$1" = "-f" ] + then + FULLCMD=1 + shift + fi + for leaf in ${@:-$$} do - ps -eo pid,ppid,command 2>&- | awk -v leaf="$leaf" \ + ps -wweo pid,ppid,command | awk -v fullcmd=$FULLCMD -v leaf="$leaf" \ '{ parent[$1]=$2 ; command[$1]=$3 ; + if (fullcmd && NF>=4) { + for (i=4; i<=NF; i++) { + command[$1]=command[$1]" "$i ; + } + } } function print_ancestry(pid) { diff --git a/10_Environment.zsh b/10_Environment.zsh index 6d33610..ce82154 100644 --- a/10_Environment.zsh +++ b/10_Environment.zsh @@ -64,7 +64,7 @@ _tx_=${${has_termcaps:+"x"}:-"|"} PS1_ROOT=${PS1_ROOT:-$color[red]} PS1_USER=${PS1_USER:-$color[blue]} # Specific color for YeahConsole -PS1_YEAH="38;5;82" +PS1_YEAH="38;5;124" ## Variables d'environnement ``classiques'' # diff --git a/11_Colors.zsh b/11_Colors.zsh index b61ebae..d5ae7ce 100644 --- a/11_Colors.zsh +++ b/11_Colors.zsh @@ -81,7 +81,7 @@ __set_prompt_colors () _gcl_colors[init]="$color[black];$color[bold]" _gcl_colors[gitdir]="$color[red];$color[bold]" _gcl_colors[uptodate]="38;5;39" - _gcl_colors[merging]="$color[bg-black]" + _gcl_colors[merging]="48;5;202" _gcl_colors[changed]="$color[green]" _gcl_colors[cached]="$color[yellow];$color[bold]" _gcl_colors[mixed]="$color[green];$color[bold]" diff --git a/12_Prompts.zsh b/12_Prompts.zsh index c8b791f..61db556 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -59,17 +59,23 @@ chpwd() preexec () { - __term_title "$2" - - __set_prompt_date exec - - # Only redraws the date, not the full prompt, since we got glitches with BANG_HIST and AUTOCORRECT... - tput sc # save cursor position - up_up # go to start of current prompt - print -Pn "$(__show_date)" # prints date - tput rc # restore cursor position - - print -Pn "$C_$_prompt_colors[exec]$_C" + __term_title "$2" + case "$_yeahconsole" in + "true") + ;; + *) + + __set_prompt_date exec + + # Only redraws the date, not the full prompt, since we got glitches with BANG_HIST and AUTOCORRECT... + tput sc # save cursor position + up_up # go to start of current prompt + print -Pn "$(__show_date)" # prints date + tput rc # restore cursor position + ;; + esac + + print -Pn "$C_$_prompt_colors[exec]$_C" } __set_prompt_date() @@ -87,11 +93,17 @@ __set_prompt_date() __update_prompt_elements() { - __term_title - __set_prompt_date - __hbar + __term_title + case "$_yeahconsole" in + "true") + ;; + *) + __set_prompt_date + __hbar - CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%~)"$C_$color[none]$_C + CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%$(($(tput cols)-80))<…<%~)"$C_$color[none]$_C + ;; + esac } @@ -267,7 +279,9 @@ zle -N __redefine_prompt __yeah_prompt () { - PS1=$C_$prompt_color[default]$_C$C_$_prompt_colors[user]$_C"%n"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%m "$CURDIR${VCSBRANCH:+ $VCSBRANCH}" "$C_$_prompt_colors[dies]$_C">"$C_$_prompt_colors[cmd]$_C" " + #PS1=$C_$prompt_color[default]$_C$C_$_prompt_colors[user]$_C"%n"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%m "$CURDIR${VCSBRANCH:+ $VCSBRANCH}" "$C_$_prompt_colors[dies]$_C">"$C_$_prompt_colors[cmd]$_C" " + PS1=$C_$_prompt_colors[dies]$_C"] " + RPS1=$C_$_prompt_colors[path]$_C"%~" PS2="$C_$_prompt_colors[soft_generic]$_C$(for i in {2..$#lastline} ; print -n "·" ; tput sc ; print -n "\r")$C_$color[yellow];$color[bold]$_C%_$(tput rc)$C_$color[none]$_C " } diff --git a/13_ZshHighlight.zsh b/13_ZshHighlight.zsh index d2715f4..f0fe8bd 100644 --- a/13_ZshHighlight.zsh +++ b/13_ZshHighlight.zsh @@ -38,6 +38,7 @@ ZSH_HIGHLIGHT_STYLES[function]="fg=cyan,bold,underline" ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=blue" ZSH_HIGHLIGHT_STYLES[path]="fg=blue" +ZSH_HIGHLIGHT_STYLES[path_approx]="fg=magenta,bg=color106" ZSH_HIGHLIGHT_STYLES[globbing]="fg=blue,bold" ZSH_HIGHLIGHT_STYLES[commandseparator]="none" diff --git a/net:anevia.com/user:hhiegel/Aliases.zsh b/net:anevia.com/user:hhiegel/Aliases.zsh new file mode 100644 index 0000000..7596981 --- /dev/null +++ b/net:anevia.com/user:hhiegel/Aliases.zsh @@ -0,0 +1,3 @@ + +alias pbuilder='sudo DIST=$DIST BASE=$BASE ARCH=$ARCH pbuilder' + diff --git a/net:anevia.com/user:hhiegel/Colors.zsh b/net:anevia.com/user:hhiegel/Colors.zsh index 8b0c37a..8c8432f 100644 --- a/net:anevia.com/user:hhiegel/Colors.zsh +++ b/net:anevia.com/user:hhiegel/Colors.zsh @@ -1,12 +1,16 @@ typeset -A _env_colors -_env_colors[dist_none]="38;5;21" -_env_colors[dist_lenny]="38;5;40" -_env_colors[dist_wheezy]="38;5;69" +_env_colors[dist_none]="38;5;19" +_env_colors[dist_lenny]="38;5;21" +_env_colors[dist_wheezy]="38;5;26" _env_colors[base_none]="38;5;196" _env_colors[base_stable]="38;5;82" _env_colors[base_testing]="38;5;62" _env_colors[base_unstable]="38;5;69" +_env_colors[arch_none]="38;5;196" +_env_colors[arch_i386]="38;5;62" +_env_colors[arch_amd64]="38;5;69" + diff --git a/net:anevia.com/user:hhiegel/Environment.zsh b/net:anevia.com/user:hhiegel/Environment.zsh index e4bde09..300a371 100644 --- a/net:anevia.com/user:hhiegel/Environment.zsh +++ b/net:anevia.com/user:hhiegel/Environment.zsh @@ -2,4 +2,5 @@ PATH+=:~/Work/Tools/bin export EMAIL="hugues.hiegel@anevia.com" +export DEBFULLNAME="Hugues Hiegel" diff --git a/net:anevia.com/user:hhiegel/Functions.zsh b/net:anevia.com/user:hhiegel/Functions.zsh index 021fa56..49dc6a5 100644 --- a/net:anevia.com/user:hhiegel/Functions.zsh +++ b/net:anevia.com/user:hhiegel/Functions.zsh @@ -2,19 +2,30 @@ __debian_dist() { [ -e ~/.pbuilderrc ] || return + eval $(grep '^:' ~/.pbuilderrc) - _dist=${DIST:-$(awk < ~/.pbuilderrc '/DIST:=/ { gsub(/^.*{DIST:=/, "") ; gsub(/}$/, "") ; print ; exit }')} - print -Pn $C_${_env_colors[dist_$_dist]:-$_env_colors[dist_none]} + print -Pn $T_$_tu_$_T" " + + #_dist=${DIST:-$(awk < ~/.pbuilderrc '/DIST:=/ { gsub(/^.*{DIST:=/, "") ; gsub(/}$/, "") ; print ; exit }')} + print -Pn $C_${_env_colors[dist_$DIST]:-$_env_colors[dist_none]} ( export | grep -q '^DIST=' ) && print -Pn ";"$color[bold] print -Pn $_C - print -n $_dist + print -n $DIST print -Pn $C_"38;5;33"$_C"-" - _base=${BASE:-$(awk < ~/.pbuilderrc '/BASE:=/ { gsub(/^.*{BASE:=/, "") ; gsub(/}$/, "") ; print ; exit }')} - print -Pn $C_${_env_colors[base_$_base]:-$_env_colors[base_none]} + #_base=${BASE:-$(awk < ~/.pbuilderrc '/BASE:=/ { gsub(/^.*{BASE:=/, "") ; gsub(/}$/, "") ; print ; exit }')} + print -Pn $C_${_env_colors[base_$BASE]:-$_env_colors[base_none]} ( export | grep -q '^BASE=' ) && print -Pn ";"$color[bold] print -Pn $_C - print -n $_base + print -n $BASE + + print -Pn $C_${_env_colors[arch_$ARCH]:-$_env_colors[arch_none]} + ( export | grep -q '^ARCH=' ) && print -Pn ";"$color[bold] + print -Pn $_C + print -n " "$ARCH + + print -Pn $C_$_prompt_colors[bar]$_C + print -Pn " "$T_$_tt_$_T } diff --git a/net:anevia.com/user:hhiegel/Prompts.zsh b/net:anevia.com/user:hhiegel/Prompts.zsh index 6a4d7f9..3723dc1 100644 --- a/net:anevia.com/user:hhiegel/Prompts.zsh +++ b/net:anevia.com/user:hhiegel/Prompts.zsh @@ -1,3 +1,13 @@ -PS1_TASKBAR+=(__debian_dist) +function __Preload () { + local _preload="" + for lib in "$LD_PRELOAD" + do + _preload=${_preload:+$_preload }${${${lib:t}#lib}%%.*} + done + + echo ${_preload:+$T_$_tu_$_T $_preload $T_$_tt_$_T} +} +PS1_TASKBAR+=(__Preload) +PS1_TASKBAR+=(__debian_dist) diff --git a/net:anevia.com/user:hugues b/net:anevia.com/user:hugues new file mode 120000 index 0000000..caa2373 --- /dev/null +++ b/net:anevia.com/user:hugues @@ -0,0 +1 @@ +user:hhiegel
\ No newline at end of file diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting -Subproject 5320f1e18d5782e29a6637937e37a3aecf9327b +Subproject 3dc574190071ef59054f6d693132410b37aa3ae |