diff options
-rw-r--r-- | 00_Sanity.zsh | 2 | ||||
-rw-r--r-- | 01_Functions.zsh | 25 | ||||
-rw-r--r-- | 11_Colors.zsh | 3 | ||||
-rw-r--r-- | 12_Prompts.zsh | 21 | ||||
-rw-r--r-- | host:openwide-desktop/Environment.zsh | 4 | ||||
-rw-r--r-- | host:patate/user:hugues/Aliases.zsh | 3 | ||||
-rw-r--r-- | host:patate/user:hugues/Environment.zsh | 3 | ||||
-rw-r--r-- | host:vlab/Environment.zsh | 2 | ||||
l--------- | net:hiegel.fr | 2 | ||||
l--------- | net:ordener.fr | 1 | ||||
-rw-r--r-- | net:sweethome/Aliases.zsh (renamed from net:ordener.fr/Aliases.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/Environment.zsh (renamed from net:ordener.fr/Environment.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/Hashes.zsh (renamed from net:ordener.fr/Hashes.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/host:delphine/Hashes.zsh (renamed from net:ordener.fr/host:delphine/Hashes.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/Aliases.zsh (renamed from host:prunelle/Aliases.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/Environment.zsh (renamed from host:prunelle/Environment.zsh) | 0 | ||||
-rw-r--r-- | net:sweethome/host:prunelle/README (renamed from host:prunelle/README) | 0 | ||||
-rw-r--r-- | user:hugues/Environment.zsh | 2 | ||||
-rw-r--r-- | user:hugues/KeyBindings.zsh | 2 |
19 files changed, 57 insertions, 13 deletions
diff --git a/00_Sanity.zsh b/00_Sanity.zsh index 39ba813..6dcea64 100644 --- a/00_Sanity.zsh +++ b/00_Sanity.zsh @@ -12,7 +12,7 @@ ulimit -c 0 # No dangerous world-writeable files & folders -umask 067 +umask 022 # sanity [[ -t 0 ]] && /bin/stty erase "^H" intr "^C" susp "^Z" dsusp "^Y" stop "^S" start "^Q" kill "^U" >& /dev/null diff --git a/01_Functions.zsh b/01_Functions.zsh index 3d1221d..d4c77bf 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -29,7 +29,7 @@ term_title() sun-cmd) print -Pn "\e]l%n@%m %~$1\e\\" # Never tested.. ;; - *term*|rxvt*) + *term*|rxvt*|putty) print -Pn "\e]0;%n@%m (%l) %~$1\a" # Sets term title ;; screen) @@ -83,14 +83,25 @@ get_git_branch () # a call to `get_git_branch` get_git_status () { - local my_git_status + local my_git_status cached not_up_to_date managment_folder - if [ "$(git-rev-parse --git-dir)" == "." ] - then - my_git_status="$git_colors[managment_folder]" - elif [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + if [ "$(git-rev-parse --git-dir)" == "." ] ; then + echo "$git_colors[managment_folder]" + return + fi + + if [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then + cached="yes" + fi + if [ "$(git-ls-files -m 2>&-)" != "" ] ; then + not_up_to_date="yes" + fi + + if [ "$cached" != "" -a "$not_up_to_date" != "" ] ; then + my_git_status="$git_colors[cached_and_not_up_to_date]" + elif [ "$cached" != "" ] ; then my_git_status="$git_colors[cached]" - elif [ "$(git-ls-files -m 2>&-)" != "" ] ; then + elif [ "$not_up_to_date" != "" ] ; then my_git_status="$git_colors[not_up_to_date]" else my_git_status="$git_colors[up_to_date]" diff --git a/11_Colors.zsh b/11_Colors.zsh index 9fcab01..73f94e2 100644 --- a/11_Colors.zsh +++ b/11_Colors.zsh @@ -70,7 +70,8 @@ set_prompt_colors () git_colors[managment_folder]="$color[red];$color[bold]" # .git/... folder browsing git_colors[cached]="$prompt_colors[to_be_commited]" # git changes in cache - git_colors[not_up_to_date]="$prompt_colors[not_up_to_date]" # git changes in working tree + git_colors[cached_and_not_up_to_date]="$prompt_colors[not_up_to_date];$color[bold]" + git_colors[not_up_to_date]="$prompt_colors[not_up_to_date];$color[normal]" # git changes in working tree git_colors[up_to_date]="$prompt_colors[up_to_date]" # git up-to-date } diff --git a/12_Prompts.zsh b/12_Prompts.zsh index a5b7348..b6cf511 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -24,7 +24,8 @@ set_prompt_colors $prompt_colors[generic] preexec () { - term_title " ··· $(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g')" + local my_sep=$([ "$TERM" = "putty" ] && echo "---" || echo "···") + term_title " $my_sep $(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g')" print -Pn "$C_$prompt_colors[exec]$_C" } @@ -56,22 +57,31 @@ old_precmd() { # Error error=$(print -Pn "%(?;;-%?)") + [ "$DEBUG" = "yes" ] && echo -n " Error code..." ERRORSIZE=${#error} ERROR="%(?;;"$C_$prompt_colors[bar]$_C"-"$C_$prompt_colors[error]$_C"%?)" + [ "$DEBUG" = "yes" ] && echo + [ "$DEBUG" = "yes" ] && echo -n " Term title..." # Flush the term title term_title + [ "$DEBUG" = "yes" ] && echo # Date + [ "$DEBUG" = "yes" ] && echo -n " Date..." DATE=$C_$prompt_colors[braces]$_C"[ "$C_$prompt_colors[date]$_C"%D{%a-%d-%b-%Y %H:%M:%S}"$C_$prompt_colors[braces]$_C" ]"$C_$prompt_colors[bar]$_C"-" DATEEXPAND=$(expand_text "$DATE") DATESIZE=${#DATEEXPAND} + [ "$DEBUG" = "yes" ] && echo # Mailcheck + [ "$DEBUG" = "yes" ] && echo -n " Mails..." MAILSTAT=$(eval echo "`[ -s ~/.procmail/procmail.log ] && < ~/.procmail/procmail.log awk 'BEGIN {RS="From" ; HAM=-1 ; LISTES=0 } !/JUNK/ { HAM++ } /Listes|Newsletters|Notifications/ { LISTES++ } END { if ((HAM - LISTES) > 0) { print "$C_$prompt_colors[bar]$_C""-""$C_$mail_colors[unread]$_C""@" } else if (LISTES > 0) { print "$C_$prompt_colors[bar]$_C""-""$C_$mail_colors[listes]$_C""@" } }'`") MAILSTATEXPAND=$(expand_text "$MAILSTAT") MAILSTATSIZE=${#MAILSTATEXPAND} + [ "$DEBUG" = "yes" ] && echo + [ "$DEBUG" = "yes" ] && echo -n " Horizontal bar..." # First line of prompt, calculation of the remaining place spaceleft=$((1 + $COLUMNS - $ERRORSIZE - $MAILSTATSIZE - $DATESIZE)) @@ -80,6 +90,7 @@ old_precmd() do HBAR=$HBAR- done + [ "$DEBUG" = "yes" ] && echo ## ## Second line of prompt : don't let the path garbage the entire line @@ -87,6 +98,7 @@ old_precmd() # get svn status # + [ "$DEBUG" = "yes" ] && echo -n " SVN status..." SVNREV=$(LC_ALL=C svn info 2>&- $PWD | awk '/^Revision: / {print $2}') SVNREVSIZE=${#${SVNREV:+:r$SVNREV}} if [ "$SVNREV" != "" ] @@ -96,16 +108,22 @@ old_precmd() SVNSTATUS=${SVNSTATUS:-$prompt_colors[up_to_date]} fi SVNREV=${SVNREV:+$C_$prompt_colors[doubledot]$_C:$C_$SVNSTATUS$_C"r"$SVNREV} + [ "$DEBUG" = "yes" ] && echo # get git status # + [ "$DEBUG" = "yes" ] && echo -n " GIT status..." GITBRANCH=$(get_git_branch) GITBRANCHSIZE=${#GITBRANCH} [ $GITBRANCHSIZE -gt 0 ] && GITBRANCHSIZE=$(($GITBRANCHSIZE)) + [ "$DEBUG" = "yes" ] && echo + [ "$DEBUG" = "yes" ] && echo -n " Path..." MY_PATH="%(!.%d.%~)" PATHSIZE=$(print -Pn $MY_PATH) PATHSIZE=${#PATHSIZE} + [ "$DEBUG" = "yes" ] && echo + [ "$DEBUG" = "yes" ] && echo -n " Resize path / gitbranch..." spaceleft=`print -Pn "%n@%m $ ls -laCdtrux $(expand_text "$DATE")"` spaceleft=$(($COLUMNS - ${#spaceleft})) #minimalpathsize=`print -Pn "../%1~"` @@ -137,6 +155,7 @@ old_precmd() [ $spaceleft -lt $minimalpathsize ] && spaceleft=$minimalpathsize GITBRANCH=${GITBRANCH:+$C_$prompt_colors[doubledot]$_C:$C_"$(get_git_status)"$_C$GITBRANCH} CURDIR="$C_$prompt_colors[path]$_C%`echo $spaceleft`<..<"$MY_PATH"%<<$C_$color[none]$_C" + [ "$DEBUG" = "yes" ] && echo ## Le prompt le plus magnifique du monde, et c'est le mien ! # Affiche l'user, l'host, le tty et le pwd. Rien que ça... diff --git a/host:openwide-desktop/Environment.zsh b/host:openwide-desktop/Environment.zsh new file mode 100644 index 0000000..2dfa543 --- /dev/null +++ b/host:openwide-desktop/Environment.zsh @@ -0,0 +1,4 @@ +PS1_USER=$color[yellow] +PS1_USER_SSH=$PS1_USER + +source /etc/dash.conf diff --git a/host:patate/user:hugues/Aliases.zsh b/host:patate/user:hugues/Aliases.zsh new file mode 100644 index 0000000..a2832cd --- /dev/null +++ b/host:patate/user:hugues/Aliases.zsh @@ -0,0 +1,3 @@ + +a vim=$EDITOR + diff --git a/host:patate/user:hugues/Environment.zsh b/host:patate/user:hugues/Environment.zsh new file mode 100644 index 0000000..7862fa1 --- /dev/null +++ b/host:patate/user:hugues/Environment.zsh @@ -0,0 +1,3 @@ +export EDITOR=~/sbin/vim +export VISUAL=$EDITOR +export FCEDIT=$EDITOR diff --git a/host:vlab/Environment.zsh b/host:vlab/Environment.zsh new file mode 100644 index 0000000..0e5fa92 --- /dev/null +++ b/host:vlab/Environment.zsh @@ -0,0 +1,2 @@ +PS1_USER=$color[red] +PS1_USER_SSH=$PS1_USER diff --git a/net:hiegel.fr b/net:hiegel.fr index 725ab49..dae2782 120000 --- a/net:hiegel.fr +++ b/net:hiegel.fr @@ -1 +1 @@ -net:ordener.fr
\ No newline at end of file +net:sweethome
\ No newline at end of file diff --git a/net:ordener.fr b/net:ordener.fr new file mode 120000 index 0000000..dae2782 --- /dev/null +++ b/net:ordener.fr @@ -0,0 +1 @@ +net:sweethome
\ No newline at end of file diff --git a/net:ordener.fr/Aliases.zsh b/net:sweethome/Aliases.zsh index b82b99c..b82b99c 100644 --- a/net:ordener.fr/Aliases.zsh +++ b/net:sweethome/Aliases.zsh diff --git a/net:ordener.fr/Environment.zsh b/net:sweethome/Environment.zsh index ed3734a..ed3734a 100644 --- a/net:ordener.fr/Environment.zsh +++ b/net:sweethome/Environment.zsh diff --git a/net:ordener.fr/Hashes.zsh b/net:sweethome/Hashes.zsh index 415e0c6..415e0c6 100644 --- a/net:ordener.fr/Hashes.zsh +++ b/net:sweethome/Hashes.zsh diff --git a/net:ordener.fr/host:delphine/Hashes.zsh b/net:sweethome/host:delphine/Hashes.zsh index da06ce8..da06ce8 100644 --- a/net:ordener.fr/host:delphine/Hashes.zsh +++ b/net:sweethome/host:delphine/Hashes.zsh diff --git a/host:prunelle/Aliases.zsh b/net:sweethome/host:prunelle/Aliases.zsh index 03b6b3f..03b6b3f 100644 --- a/host:prunelle/Aliases.zsh +++ b/net:sweethome/host:prunelle/Aliases.zsh diff --git a/host:prunelle/Environment.zsh b/net:sweethome/host:prunelle/Environment.zsh index 219e88e..219e88e 100644 --- a/host:prunelle/Environment.zsh +++ b/net:sweethome/host:prunelle/Environment.zsh diff --git a/host:prunelle/README b/net:sweethome/host:prunelle/README index 33e3fd8..33e3fd8 100644 --- a/host:prunelle/README +++ b/net:sweethome/host:prunelle/README diff --git a/user:hugues/Environment.zsh b/user:hugues/Environment.zsh index bf64adc..7b99de4 100644 --- a/user:hugues/Environment.zsh +++ b/user:hugues/Environment.zsh @@ -33,7 +33,7 @@ export LC_MESSAGES=${LC_MESSAGES:-fr_FR} unset LANG # Unuseful # Couleurs pour grep --color=auto -export GREP_COLOR=$YELLOW\;$BOLD +export GREP_COLOR=$color[yellow]\;$color[bold] cmd_exists dircolors && eval $(dircolors ~/.dir_colors) export TZ="Europe/Paris" diff --git a/user:hugues/KeyBindings.zsh b/user:hugues/KeyBindings.zsh index a49dd90..f87c53b 100644 --- a/user:hugues/KeyBindings.zsh +++ b/user:hugues/KeyBindings.zsh @@ -211,7 +211,7 @@ bindkey -s 't' 'Q todo\n' bindkey -s 'é' ' 2>/dev/null ' bindkey -s '2' ' 2>&1 ' -bindkey -s 'm' 'Q make\n' +bindkey -s 'm' 'Q mails\n' bindkey -s 'M' 'Q make\n' bindkey -s 'l' 'Q l\n' |