diff options
-rw-r--r-- | 12_Prompts.zsh | 7 | ||||
-rw-r--r-- | 13_ZshHighlight.zsh | 33 | ||||
-rw-r--r-- | net:foret/Colors.zsh | 6 | ||||
-rw-r--r-- | net:foret/Completion.zsh | 2 | ||||
-rw-r--r-- | net:foret/Functions.zsh | 34 | ||||
-rw-r--r-- | net:foret/Prompts.zsh | 16 | ||||
-rw-r--r-- | net:foret/compsys/sdk/_endurance (renamed from net:foret/completion/_endurance) | 0 | ||||
-rw-r--r-- | net:foret/compsys/sdk/_sdk-targets (renamed from net:foret/completion/_sdk-targets) | 0 | ||||
-rw-r--r-- | user:hugues/Environment.zsh | 2 | ||||
-rw-r--r-- | zshrc | 73 |
10 files changed, 127 insertions, 46 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh index d49b947..f4c04e9 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -83,11 +83,10 @@ __update_prompt_elements() __term_title __set_prompt_date __hbar - - CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%~)"$C_$color[none]$_C - } +CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%~)"$C_$color[none]$_C + __error_code () { # Error @@ -312,7 +311,9 @@ __two_lines_prompt () 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 " __debug "------------------------------" + #RPROMPT=$C_$_prompt_colors[bar]$_C"%{"$T_"%}m"${(l:$(($DATESIZE - 3))::q:)}"j%{"$_T"%}" } +unset RPROMPT if ( ! __zsh_status ) then diff --git a/13_ZshHighlight.zsh b/13_ZshHighlight.zsh index d2715f4..ac0ec21 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=red,bold,underline" ZSH_HIGHLIGHT_STYLES[globbing]="fg=blue,bold" ZSH_HIGHLIGHT_STYLES[commandseparator]="none" @@ -56,3 +57,35 @@ ZSH_HIGHLIGHT_STYLES[root]="standout" ZSH_HIGHLIGHT_STYLES[unknown-token]="fg=red,bold" +#ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]="fg=white,underline,bold" +#ZSH_HIGHLIGHT_STYLES[path_approx]="fg=yellow,underline" +#ZSH_HIGHLIGHT_STYLES[builtin]="fg=normal,bold" +#ZSH_HIGHLIGHT_STYLES[root]="standout" +#ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]="fg=yellow,bold" +#ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=yellow,bold" +#ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=green,bold" +#ZSH_HIGHLIGHT_STYLES[back-quoted-argument]="green" +#ZSH_HIGHLIGHT_STYLES[bracket-error]="fg=red,bold" +#ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]="fg=blue,bold" +#ZSH_HIGHLIGHT_STYLES[cursor]="bold" +#ZSH_HIGHLIGHT_STYLES[bracket-level-1]="fg=yellow,bold" +#ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=blue,bold" +#ZSH_HIGHLIGHT_STYLES[bracket-level-2]="fg=green" +#ZSH_HIGHLIGHT_STYLES[path]="fg=blue" +#ZSH_HIGHLIGHT_STYLES[precommand]="fg=blue,bold" +#ZSH_HIGHLIGHT_STYLES[bracket-level-3]="fg=cyan,bold" +#ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=blue" +#ZSH_HIGHLIGHT_STYLES[globbing]="fg=blue,bold" +#ZSH_HIGHLIGHT_STYLES[bracket-level-4]="fg=blue" +#ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=blue" +#ZSH_HIGHLIGHT_STYLES[bracket-level-5]="fg=magenta" +#ZSH_HIGHLIGHT_STYLES[path_prefix]="underline" +#ZSH_HIGHLIGHT_STYLES[alias]="fg=cyan,underline" +#ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=normal,bold,underline" +#ZSH_HIGHLIGHT_STYLES[commandseparator]="none" +#ZSH_HIGHLIGHT_STYLES[command]="fg=cyan" +#ZSH_HIGHLIGHT_STYLES[unknown-token]="fg=red,bold" +#ZSH_HIGHLIGHT_STYLES[default]="fg=cyan" +#ZSH_HIGHLIGHT_STYLES[assign]="fg=cyan" +#ZSH_HIGHLIGHT_STYLES[function]="fg=cyan,bold,underline" +#ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=cyan,bold" diff --git a/net:foret/Colors.zsh b/net:foret/Colors.zsh index d56bcbd..d7bd7c0 100644 --- a/net:foret/Colors.zsh +++ b/net:foret/Colors.zsh @@ -2,8 +2,14 @@ typeset -A _make_colors _make_colors[target]=$color[red] + _make_colors[verbose]=$color[yellow] + _make_colors[nproc]=$color[yellow] + _make_colors[static]=$color[green] _make_colors[dynamic]=$color[yellow] +_make_colors[sdk]=$color[cyan]";"$color[bold] + +_make_colors[gcc]=$color[blue]";"$color[bold] diff --git a/net:foret/Completion.zsh b/net:foret/Completion.zsh index 0243102..50e1708 100644 --- a/net:foret/Completion.zsh +++ b/net:foret/Completion.zsh @@ -8,6 +8,6 @@ ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## -fpath=($specific_script:h/completion $fpath) +fpath=($subscript:h/compsys/sdk $fpath) compinit diff --git a/net:foret/Functions.zsh b/net:foret/Functions.zsh new file mode 100644 index 0000000..0a77351 --- /dev/null +++ b/net:foret/Functions.zsh @@ -0,0 +1,34 @@ + +_cn () { + local _CN=/usr/local/Cavium_Networks/ + local SDK MODEL GCC + case $1 in + ([Oo]+*) MODEL=OCTEON_CN58XX + SDK=${2:-OCTEON-SDK-1.7.2} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEONPLUS_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + ([Oo]2*) case $1 in + (O*) MODEL=OCTEON_CN68XX ;; + (o*) MODEL=OCTEON_CN66XX ;; + esac + SDK=${2:-cnUSERS-SDK-2.3} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEON2_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + (*) TARGET=x86_64-LSB-SMP-PERF-EXTFLOW + unset OCTEON_ROOT ;; + esac + PATH=${(j/:/)$(echo ${${(s/:/)PATH}##/usr/local/Cavium_Networks/*})} + if [ -n "$SDK" ] + then + pushd $_CN/$SDK > /dev/null 2>&1 + source ./env-setup $MODEL --runtime-model --tools=$GCC + popd > /dev/null 2>&1 + fi +} + diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh index 85c30f4..317f8cc 100644 --- a/net:foret/Prompts.zsh +++ b/net:foret/Prompts.zsh @@ -8,8 +8,6 @@ ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## -_prompt_colors[target]="1;31" - __static_dynamic () { [ $(( ${STATIC:-$(( 1 ^ ${DYNAMIC:-0} ))} + ${DYNAMIC:-$(( 1 ^ ${STATIC:-0} ))} )) -lt 2 ] && \ @@ -75,5 +73,17 @@ __makeflags () echo -n $_prompt_colors[soft_generic]";3"$_C${MAKEFLAGS// -/} } -PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation __static_dynamic __compilation_os __compilation_arch __compilation_target) +__octeon_sdk() { + [ -z "$OCTEON_ROOT" ] && return + echo -n $C_$_make_colors[sdk]$_C + echo -n ${OCTEON_ROOT##/usr/local/Cavium_Networks/} +} + +__cavium_gcc_version() { + GCC_VERSION=$(echo $PATH | tr ':' '\n' | sed -n "s:$OCTEON_ROOT/tools-gcc-\(.*\)/bin:\1:p;Tend;q;:end" ) + [ -z "$GCC_VERSION" ] && return + echo -n $C_$_make_colors[gcc]$_C$GCC_VERSION +} + +PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation __static_dynamic __compilation_os __compilation_arch __compilation_target __octeon_sdk __cavium_gcc_version) PS1_EXTRA_INFO+=() diff --git a/net:foret/completion/_endurance b/net:foret/compsys/sdk/_endurance index 1af5d51..1af5d51 100644 --- a/net:foret/completion/_endurance +++ b/net:foret/compsys/sdk/_endurance diff --git a/net:foret/completion/_sdk-targets b/net:foret/compsys/sdk/_sdk-targets index 3428566..3428566 100644 --- a/net:foret/completion/_sdk-targets +++ b/net:foret/compsys/sdk/_sdk-targets diff --git a/user:hugues/Environment.zsh b/user:hugues/Environment.zsh index 112110e..21d6d8b 100644 --- a/user:hugues/Environment.zsh +++ b/user:hugues/Environment.zsh @@ -49,7 +49,7 @@ done export GREP_COLOR=$color[yellow]\;$color[bold] export GREP_COLORS="sl="":cx="$color[cyan]":ms="$color[yellow]";"$color[bold]":mc="$color[red]";"$color[bold]":fn="$color[green]"" -__cmd_exists dircolors && eval $(dircolors ~/.dir_colors) +__cmd_exists dircolors && eval $(dircolors) export TZ="Europe/Paris" export TIME_STYLE="+%Y-%b-%d %H:%M:%S" @@ -6,12 +6,12 @@ # # If you want to add a file, name it specifically in the form # -# $ZDOTDIR/??_*.zsh +# $ZDOTDIR/??_*.zsh # # Where "??" should be a two-digit number. # With that, file ``10_Toto.zsh'' would be parsed before # file ``20_Tutu.zsh'', allowing you ordering your scripts. -# +# # If you want to make user, host or network specific configurations, # add your specific scripts to the folders # - "sys:$(uname -s)" for OS-specific conf, @@ -55,6 +55,38 @@ export USER HOST DOMAIN UID if [ -d $ZDOTDIR ]; then + recurse_load() { + local script=$1 + local root=$2 + + for f in \ + net:$DOMAIN \ + host:$HOST \ + sys:$OSNAME \ + user:$USER \ + user:$SUDO_USER + do + if test -d $root/$f + then + subscript=$root/$f/$script + if test -f $subscript + then + __debug -n "${${subscript:h}##$ZDOTDIR\/}/$script... "; + echo source $subscript + __debug + fi + if test -f $subscript.gpg + then + __debug -n "${${subscript:h}##$ZDOTDIR\/}/$script [CRYPTED]... "; + echo eval \$(gpg --quiet --decrypt $subscript.gpg) + __debug + fi + + recurse_load $script $root/$f + fi + done + } + for script in $ZDOTDIR/??_*.zsh do @@ -62,42 +94,7 @@ if [ -d $ZDOTDIR ]; then source $script __debug - for i in "net:$DOMAIN"\ - "host:$HOST"\ - "sys:$OSNAME"\ - "user:$USER"\ - "user:$USER/net:$DOMAIN"\ - "user:$SUDO_USER"\ - "net:$DOMAIN/host:$HOST"\ - "net:$DOMAIN/sys:$OSNAME"\ - "net:$DOMAIN/user:$USER"\ - "net:$DOMAIN/user:$SUDO_USER"\ - "net:$DOMAIN/host:$HOST/sys:$OSNAME"\ - "net:$DOMAIN/host:$HOST/user:$USER"\ - "net:$DOMAIN/host:$HOST/user:$SUDO_USER"\ - "net:$DOMAIN/host:$HOST/sys:$OSNAME"\ - "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$USER"\ - "net:$DOMAIN/host:$HOST/sys:$OSNAME/user:$SUDO_USER"\ - "host:$HOST/sys:$OSNAME"\ - "host:$HOST/user:$USER"\ - "host:$HOST/user:$SUDO_USER"\ - "host:$HOST/sys:$OSNAME/user:$USER"\ - "host:$HOST/sys:$OSNAME/user:$SUDO_USER" - do - specific_script=${script:h}/$i/${${script:t}/??_/} - if test -f $specific_script - then - __debug -n "$i/${${specific_script:t:r}/??_/}... "; - source $specific_script - __debug - fi - if test -f $specific_script.gpg - then - __debug -n "$i/${${specific_script:t:r}/??_/} [CRYPTED]... "; - eval $(gpg --quiet --decrypt $specific_script.gpg) - __debug - fi - done + eval $(recurse_load ${${script:t}/??_/} ${script:h}) done fi |