From 72896f1d1d0ae633d360aede3956d42036fd600d Mon Sep 17 00:00:00 2001 From: hugues Date: Wed, 16 May 2007 10:17:44 +0000 Subject: =?utf-8?q?Tout=20plein=20de=20modifs,=20du=20m=C3=A9nage,=20des=20trucs=20en=20plus, =20plus=20beaux,=20moins=20moches,=20plus=20mieux=20et=20tout=20et=20tout=208-)?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.5.4.1" This is a multi-part message in MIME format. --------------1.5.4.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@382 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- .zshrc | 12 ++- 00_Preamble.zsh | 32 ------ 00_Sanity.zsh | 19 ++++ 01_Functions.zsh | 60 +++++++++++ 10_Environment.zsh | 81 +++++++++++++++ 10_Options.zsh | 77 -------------- 11_Prompts.zsh | 82 +++++++++++++++ 20_Environment.zsh | 81 --------------- 20_Options.zsh | 77 ++++++++++++++ 25_Prompts.zsh | 82 --------------- 30_Completion.zsh | 62 ------------ 40_KeyBindings.zsh | 219 ---------------------------------------- 50_Aliases.zsh | 65 ++++++++++++ 50_Hashes.zsh | 9 -- 51_Hashes.zsh | 9 ++ 60_Completion.zsh | 62 ++++++++++++ 70_Aliases.zsh | 70 ------------- 80_Functions.zsh | 43 -------- 80_KeyBindings.zsh | 0 85_Debug.zsh | 50 --------- 90_DevelUtils.zsh | 50 +++++++++ 99_Exec.zsh | 12 +++ 99_Start.zsh | 12 --- host:paranoid/Aliases.zsh | 16 --- host:paranoid/Environment.zsh | 12 --- host:prunelle/Aliases.zsh | 2 +- host:prunelle/Environment.zsh | 2 +- net:example.com/Environment.zsh | 2 +- net:ordener.fr/Aliases.zsh | 16 +++ net:ordener.fr/Environment.zsh | 12 +++ user:hugues/KeyBindings.zsh | 219 ++++++++++++++++++++++++++++++++++++++++ 31 files changed, 775 insertions(+), 772 deletions(-) delete mode 100644 00_Preamble.zsh create mode 100644 00_Sanity.zsh create mode 100644 01_Functions.zsh create mode 100644 10_Environment.zsh delete mode 100644 10_Options.zsh create mode 100644 11_Prompts.zsh delete mode 100644 20_Environment.zsh create mode 100644 20_Options.zsh delete mode 100644 25_Prompts.zsh delete mode 100644 30_Completion.zsh delete mode 100644 40_KeyBindings.zsh create mode 100644 50_Aliases.zsh delete mode 100644 50_Hashes.zsh create mode 100644 51_Hashes.zsh create mode 100644 60_Completion.zsh delete mode 100644 70_Aliases.zsh delete mode 100644 80_Functions.zsh create mode 100644 80_KeyBindings.zsh delete mode 100644 85_Debug.zsh create mode 100644 90_DevelUtils.zsh create mode 100644 99_Exec.zsh delete mode 100644 99_Start.zsh delete mode 100644 host:paranoid/Aliases.zsh delete mode 100644 host:paranoid/Environment.zsh create mode 100644 net:ordener.fr/Aliases.zsh create mode 100644 net:ordener.fr/Environment.zsh create mode 100644 user:hugues/KeyBindings.zsh diff --git a/.zshrc b/.zshrc index 3643640..5ff5d81 100644 --- a/.zshrc +++ b/.zshrc @@ -23,11 +23,15 @@ ZDOTDIR=${ZDOTDIR:-~/.zsh} mkdir -p $ZDOTDIR +# Useful environment variables which may be used +# at any time - We compute them now to avoid calling +# the required processes each time we'll need. USER=${USER:-`whoami`} -HOST=${HOST:-$(hostname -s 2>/dev/null)} -DOMAIN=${DOMAIN:-${$(hostname -d 2>/dev/null):-$(hostname -y 2>/dev/null)}} +UID=${UID:-`id -u`} +HOST=${HOST:-$(hostname -s)} +DOMAIN=${DOMAIN:-${$(hostname -d):-$(hostname -y)}} -export USER HOST DOMAIN +export USER HOST DOMAIN UID if [ -d $ZDOTDIR ]; then for script in $ZDOTDIR/??_*.zsh @@ -36,7 +40,7 @@ if [ -d $ZDOTDIR ]; then [ "$DEBUG" != "" ] && echo "${${script:t:r}/??_/}... "; source $script - for i in "net:$DOMAIN" "host:$HOST" "user:$USER" + for i in "net:$DOMAIN" "host:$HOST" "user:$USER" "user:$SUDO_USER" do specific_script=${script:h}/$i/${${script:t}/??_/} if test -f $specific_script diff --git a/00_Preamble.zsh b/00_Preamble.zsh deleted file mode 100644 index 5c28439..0000000 --- a/00_Preamble.zsh +++ /dev/null @@ -1,32 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## -## No more core dumps :) -ulimit -c 0 -umask 002 - -## -## sanity -## -[[ -t 0 ]] && /bin/stty erase "^H" intr "^C" susp "^Z" dsusp "^Y" stop "^S" start "^Q" kill "^U" >& /dev/null - - -# Variables utiles - - _color_black=\033[30m - _color_red=\033[31m - _color_green=\033[32m - _color_yellow=\033[33m - _color_blue=\033[34m -_color_magenta=\033[35m - _color_cyan=\033[36m - - _unset_color=\033[0m - _color_bold=\033[1m -_color_underline=\033[4m diff --git a/00_Sanity.zsh b/00_Sanity.zsh new file mode 100644 index 0000000..b76865a --- /dev/null +++ b/00_Sanity.zsh @@ -0,0 +1,19 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +# No more core dumps :) +ulimit -c 0 + +# No dangerous world-writeable files & folders +umask 002 + +# 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 new file mode 100644 index 0000000..022a87d --- /dev/null +++ b/01_Functions.zsh @@ -0,0 +1,60 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +term_title() +{ + [[ -t 1 ]] && + case $TERM in + sun-cmd) + print -Pn "\e]l%n@%m %~$1\e\\" ;; + *term*|rxvt*) + print -Pn "\e]0;%n@%m (%l) %~$1\a" ;; + esac +} + +_chpwd() +{ + term_title +} + +chpwd() +{ + _chpwd + which todo > /dev/null 2>&1 && todo +} + +precmd () +{ +## [[ -t 1 ]] && +# print -nP "%(?,,%{%}Foirage n°%{%}%?\n)%{%}" + _chpwd +} + +preexec () +{ + term_title " ··· $1" +} + +cmd_exists () +{ + which $1 2>/dev/null >&2 +} + +normal_user () +{ + eval `grep -v '^[$#]' /etc/login.defs | tr -d '[:blank:]' | sed 's/^[A-Z_]\+/&=/'` + test \( $UID -ge $UID_MIN \) -a \( $UID -le $UID_MAX \) +} + +privileged_user () +{ + ! normal_user +} + diff --git a/10_Environment.zsh b/10_Environment.zsh new file mode 100644 index 0000000..5360382 --- /dev/null +++ b/10_Environment.zsh @@ -0,0 +1,81 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +## +## NDLA: +## +## ma politique pour l'export des variables est très simple : +## si elle a pour vocation d'être utilisée en dehors de Zsh, +## on l'exporte. SInon pas. +## + +## Options pour ``bc'' +export BC_ENV_ARGS="-q" + +## Editeur par défaut +export EDITOR=`which vim || which vi || which emacs` +export VISUAL=$EDITOR +export FCEDIT=$EDITOR + +## Pageur par défaut +export PAGER=less + +## Quelle commande utiliser par défaut ? +export NULLCMD=cat + +cmd_exists dircolors && eval $(dircolors ~/.dir_colors 2>&- ) +export TZ="Europe/Paris" +export TIME_STYLE="+%Y-%b-%d %H:%M:%S" + +## Agent de clefs SSH/GPG +# En principe il a été fait dans le .zlogin, mais si on n'est pas en +# login shell on n'aura pas ces informations. Donc on le fait ici aussi. +[ -f $ZDOTDIR/.keychain ] && source $ZDOTDIR/.keychain + +# Locale en français unicode +export LC_ALL=${LC_ALL:-fr_FR.UTF-8} +export LC_MESSAGES=${LC_MESSAGES:-fr_FR} +unset LANG # Unuseful + +## Variables d'environnement ``classiques'' +# +# L'utilisation de la forme ${VARIABLE:+$VARIABLE:} permet d'accoler ``:'' +# si et seulement si $VARIABLE contient déjà des choses, cela pour éviter +# d'avoir un PATH (p.e.) de la forme : PATH=:/bin +# +#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:~/libs +#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/X11R6/lib/pkgconfig +export PATH=$PATH:~/sbin:~/bin +privileged_user && PATH=/sbin:/usr/sbin:$PATH +export MANPATH=$MANPATH:~/man +export INFOPATH=$INFOPATH:~/info +## Nettoyage des précédentes variables pour supprimer les duplicata +typeset -gU PATH MANPATH INFOPATH PKG_CONFIG_PATH LD_LIBRARY_PATH + +## Trucs à la con spécifiques à Zsh +LOGCHECK=10 # %n has logged on/off .. +REPORTTIME=1 # ``time'' automatique +TIMEFMT='`%J` -- %P cpu + User %U + System %S + Total %E' + +WATCHFMT=$COLOR_BLUECLAIR"%n"$COLOR_END +WATCHFMT=$WATCHFMT" has "$COLOR_YELLOW"%a %l from %M" +WATCH=notme + +WORDCHARS='*?-_~!#$%^.' ## Caractères faisant partie des mots + ## J'ai viré les '/()[]{}' + +## Gestion de l'historique +# Voir le fichier d'Options pour plus de contrôle là-dessus +HISTFILE=$ZDOTDIR/.history.$USER.$HOSTNAME # Pour éviter les conflits de conf +HISTSIZE=42000 +SAVEHIST=42000 diff --git a/10_Options.zsh b/10_Options.zsh deleted file mode 100644 index 4d35898..0000000 --- a/10_Options.zsh +++ /dev/null @@ -1,77 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -## Zsh options -# -# see man zshoptions(1) for more details ;-) -# - -# J'ai pas très bien compris mais en gros ça va me permettre -# d'être sûr de retrouver ma commande dans tous les cas... -setopt Always_Last_Prompt - -setopt Always_to_End - -# Je préfère nettement faire un "export" sur les variables qui -# m'intéressent plutôt qu'utiliser cette option, car ça fait un -# peu porkasse quand même... -unsetopt All_Export - -## ``cd'' automatique -# Si la commande n'existe pas et qu'elle correspond à -# un dossier, zsh fait automatiquement un ``cd'' dessus. -# Pour les fainéants qui ont la flemme de taper "cd " :-) -setopt Auto_Cd - -## Envoie le signal CONT aux jobs passés en arrière-plan. -setopt Auto_Continue - -## Complétion automatique -setopt Auto_List -setopt Auto_Menu -# Ces trucs sont pénibles car ils n'autorisent pas une -# complétion "petit à petit". -unsetopt Menu_Complete -unsetopt Rec_Exact - -setopt Auto_Param_Keys -unsetopt Auto_Param_Slash -unsetopt Cd_Able_Vars -setopt Complete_Aliases -setopt Complete_in_Word -unsetopt Correct -setopt Correct_All -unsetopt Equals -setopt Extended_Glob -setopt Hash_Cmds -setopt Hash_Dirs - -## Gestion de l'historique -unsetopt Extended_History -setopt Hist_Expire_Dups_First -setopt Hist_Ignore_All_Dups -setopt Hist_Ignore_Space -setopt Hist_No_Functions -unsetopt Hist_No_Store -setopt Hist_Reduce_Blanks -setopt Inc_Append_History - - -setopt Magic_Equal_Subst -setopt Mail_Warning -setopt Mark_Dirs -setopt No_Bg_Nice -setopt No_Hup -setopt No_Prompt_Cr -setopt Numeric_Glob_Sort -unsetopt Prompt_Cr -setopt Auto_Pushd -setopt Pushd_Ignore_Dups -setopt Glob diff --git a/11_Prompts.zsh b/11_Prompts.zsh new file mode 100644 index 0000000..aec9f66 --- /dev/null +++ b/11_Prompts.zsh @@ -0,0 +1,82 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +VOID=0 +BOLD=1 +UNDERLINE=4 +RED=31 +GREEN=32 +YELLOW=33 +BLUE=34 +MAGENTA=35 +CYAN=36 +WHITE=37 + +# Pour personnaliser les couleurs du prompt, configurez ces variables : +# - PS1_ROOT pour la couleur du prompt ROOT +# - PS1_USER pour la couleur du prompt USER local +# - PS1_USER_SSH pour la couleur du prompt USER distant + +PS1_ROOT=$RED +PS1_USER=$BLUE +PS1_USER_SSH=$MAGENTA + +if ( [ "$SSH_TTY" != "" ] ) +then + # Couleur par défaut pour les utilisateurs normaux loggués via SSH + # Ça permet de faire une distinction rapide entre les shells locaux + # et les shells distants. C'est trop bon, mangez-en ! + PS1_USER=${PS1_USER_SSH:-$PS1_USER} +fi + +## Les couleurs !! ## +C_="%{[" +_C="m%}" +COLOR_PATH="0;%(!.$PS1_ROOT.$BOLD;$PS1_USER)" +COLOR_TERM="0;%(!.$PS1_ROOT.$PS1_USER)" +COLOR_USER="0;%(!.$PS1_ROOT.$PS1_USER)" +COLOR_HOST="0;%(!.$PS1_ROOT.$PS1_USER)" +COLOR_HIST=$VOID +COLOR_AROB="0;1;%(!.$BOLD;$PS1_ROOT.$PS1_USER)" +COLOR_DIES="0;%(!.$BOLD;$PS1_ROOT.$PS1_USER)" + +COLOR_ERRR="$BOLD;$RED" +COLOR_DATE="0;%(!.$PS1_ROOT.$PS1_USER)" + +## Prompts +# +# Pour plus d'infos sur les paramètres d'expansion du prompt: +# man zshmisc(1) +# +# La définition des prompts est séparée de celles desvariables d'environnement +# classiques pour permettre de configurer, par exemple, les couleurs par défaut +# dans ces fichiers. + +## 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... +# Note que pour le pwd, on n'affiche que les 4 derniers dossiers pour éviter +# de pourrir le fenêtre de terminal avec un prompt à rallonge. +PS1=""$C_$COLOR_USER$_C"%n"$C_$COLOR_AROB$_C"@"$C_$COLOR_HOST$_C"%m"$C_$VOID$_C" ("$C_$COLOR_TERM$_C"%y"$C_$VOID$_C") ["$C_$COLOR_PATH$_C"%(!.%d.%(5~:.../:)%4~)"$C_$VOID$_C"]"${LD_PRELOAD:t:s/lib//:r}" "$C_$COLOR_HIST$_C"%h"$C_$COLOR_DIES$_C"%#"$C_$VOID$_C" " + +# Prompt level 2 +PS2="%{%}%B%_%b%{%}%B>%b%{%} " + +# Prompt level 3 +PS3="?# " + +# Prompt level 4 +PS4="+%N:%i> " + +# Prompt de droite, pour l'heure et le code d'erreur de la dernière commande +RPS1="%(?;;"$C_$COLOR_ERRR$_C"%?"$C_$VOID$_C") "$C_$COLOR_DATE$_C"%D{%H:%M:%S %d/%m/%Y}"$C_$VOID$_C"" + +# Ultime : prompt de correction :-) +SPROMPT="zsh: $C_$BLUE$_C%B'%R'%b$C_$VOID$_C ? Vous ne vouliez pas plutôt $C_$MAGENTA$_C%B'%r'%b$C_$VOID$_C ? [%BN%byae] " + diff --git a/20_Environment.zsh b/20_Environment.zsh deleted file mode 100644 index 252083a..0000000 --- a/20_Environment.zsh +++ /dev/null @@ -1,81 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -## -## NDLA: -## -## ma politique pour l'export des variables est très simple : -## si elle a pour vocation d'être utilisée en dehors de Zsh, -## on l'exporte. SInon pas. -## - -## Options pour ``bc'' -export BC_ENV_ARGS="-q" - -## Editeur par défaut -export EDITOR=`which vim` -export VISUAL=$EDITOR -export FCEDIT=$EDITOR - -## Pageur par défaut -export PAGER=less - -## Quelle commande utiliser par défaut ? -export NULLCMD=cat - -[ `which dircolors` >/dev/null 2>&1 ] && eval $(dircolors ~/.dir_colors 2>&-) -export TZ="Europe/Paris" -export TIME_STYLE="+%Y-%b-%d %H:%M:%S" - -## Agent de clefs SSH/GPG -# En principe il a été fait dans le .zlogin, mais si on n'est pas en -# login shell on n'aura pas ces informations. Donc on le fait ici aussi. -[ -f $ZDOTDIR/.keychain ] && source $ZDOTDIR/.keychain - -# Locale en français unicode -export LC_ALL=${LC_ALL:-fr_FR.UTF-8} -export LC_MESSAGES=${LC_MESSAGES:-fr_FR} -unset LANG # Unuseful - -## Variables d'environnement ``classiques'' -# -# L'utilisation de la forme ${VARIABLE:+$VARIABLE:} permet d'accoler ``:'' -# si et seulement si $VARIABLE contient déjà des choses, cela pour éviter -# d'avoir un PATH (p.e.) de la forme : PATH=:/bin -# -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:~/libs -export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/X11R6/lib/pkgconfig -export PATH=$PATH:~/sbin:~/bin -[ `id -u` -lt 100 ] && PATH=/sbin:/usr/sbin:$PATH -export MANPATH=$MANPATH:~/man -export INFOPATH=$INFOPATH:~/info -## Nettoyage des précédentes variables pour supprimer les duplicata -typeset -gU PATH MANPATH INFOPATH PKG_CONFIG_PATH LD_LIBRARY_PATH - -## Trucs à la con spécifiques à Zsh -LOGCHECK=10 # %n has logged on/off .. -REPORTTIME=1 # ``time'' automatique -TIMEFMT='`%J` -- %P cpu - User %U - System %S - Total %E' - -WATCHFMT=$COLOR_BLUECLAIR"%n"$COLOR_END -WATCHFMT=$WATCHFMT" has "$COLOR_YELLOW"%a %l from %M" -WATCH=notme - -WORDCHARS='*?-_~!#$%^.' ## Caractères faisant partie des mots - ## J'ai viré les '/()[]{}' - -## Gestion de l'historique -# Voir le fichier d'Options pour plus de contrôle là-dessus -HISTFILE=$ZDOTDIR/.history.$USER.$HOSTNAME # Pour éviter les conflits de conf -HISTSIZE=42000 -SAVEHIST=42000 diff --git a/20_Options.zsh b/20_Options.zsh new file mode 100644 index 0000000..ca0fb85 --- /dev/null +++ b/20_Options.zsh @@ -0,0 +1,77 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +## Zsh options +# +# see man zshoptions(1) for more details ;-) +# + +# J'ai pas très bien compris mais en gros ça va me permettre +# d'être sûr de retrouver ma commande dans tous les cas... +setopt Always_Last_Prompt + +setopt Always_to_End + +# Je préfère nettement faire un "export" sur les variables qui +# m'intéressent plutôt qu'utiliser cette option, car ça fait un +# peu porkasse quand même... +unsetopt All_Export + +## ``cd'' automatique +# Si la commande n'existe pas et qu'elle correspond à +# un dossier, zsh fait automatiquement un ``cd'' dessus. +# Pour les fainéants qui ont la flemme de taper "cd " :-) +setopt Auto_Cd + +## Envoie le signal CONT aux jobs passés en arrière-plan. +setopt Auto_Continue + +## Complétion automatique +setopt Auto_List +setopt Auto_Menu +# Ces trucs sont pénibles car ils n'autorisent pas une +# complétion "petit à petit". +unsetopt Menu_Complete +unsetopt Rec_Exact + +setopt Auto_Param_Keys +unsetopt Auto_Param_Slash +unsetopt Cd_Able_Vars +setopt Complete_Aliases +setopt Complete_in_Word +unsetopt Correct +setopt Correct_All +unsetopt Equals +setopt Extended_Glob +setopt Hash_Cmds +setopt Hash_Dirs + +## Gestion de l'historique +unsetopt Extended_History +setopt Hist_Expire_Dups_First +setopt Hist_Ignore_All_Dups +setopt Hist_Ignore_Space +setopt Hist_No_Functions +unsetopt Hist_No_Store +setopt Hist_Reduce_Blanks +setopt Inc_Append_History + + +setopt Magic_Equal_Subst +setopt Mail_Warning +setopt Mark_Dirs +setopt No_Bg_Nice +setopt No_Hup +setopt No_Prompt_Cr +setopt Numeric_Glob_Sort +unsetopt Prompt_Cr +setopt Auto_Pushd +setopt Pushd_Ignore_Dups +setopt Glob diff --git a/25_Prompts.zsh b/25_Prompts.zsh deleted file mode 100644 index 6c10f8f..0000000 --- a/25_Prompts.zsh +++ /dev/null @@ -1,82 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -VOID=0 -BOLD=1 -UNDERLINE=4 -RED=31 -GREEN=32 -YELLOW=33 -BLUE=34 -MAGENTA=35 -CYAN=36 -WHITE=37 - -# Pour personnaliser les couleurs du prompt, configurez ces variables : -# - PS1_ROOT pour la couleur du prompt ROOT -# - PS1_USER pour la couleur du prompt USER local -# - PS1_USER_SSH pour la couleur du prompt USER distant - -PS1_ROOT=$RED -PS1_USER=$BLUE -PS1_USER_SSH=$MAGENTA - -if ( [ "$SSH_TTY" != "" ] ) -then - # Couleur par défaut pour les utilisateurs normaux loggués via SSH - # Ça permet de faire une distinction rapide entre les shells locaux - # et les shells distants. C'est trop bon, mangez-en ! - PS1_USER=${PS1_USER_SSH:-$PS1_USER} -fi - -## Les couleurs !! ## -C_="%{[" -_C="m%}" -COLOR_PATH="0;%(!.$PS1_ROOT.$BOLD;$PS1_USER)" -COLOR_TERM="0;%(!.$PS1_ROOT.$PS1_USER)" -COLOR_USER="0;%(!.$PS1_ROOT.$PS1_USER)" -COLOR_HOST="0;%(!.$PS1_ROOT.$PS1_USER)" -COLOR_HIST=$VOID -COLOR_AROB="0;1;%(!.$BOLD;$PS1_ROOT.$PS1_USER)" -COLOR_DIES="0;%(!.$BOLD;$PS1_ROOT.$PS1_USER)" - -COLOR_ERRR="$BOLD;$RED" -COLOR_DATE="0;%(!.$PS1_ROOT.$PS1_USER)" - -## Prompts -# -# Pour plus d'infos sur les paramètres d'expansion du prompt: -# man zshmisc(1) -# -# La définition des prompts est séparée de celles desvariables d'environnement -# classiques pour permettre de configurer, par exemple, les couleurs par défaut -# dans ces fichiers. - -## 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... -# Note que pour le pwd, on n'affiche que les 4 derniers dossiers pour éviter -# de pourrir le fenêtre de terminal avec un prompt à rallonge. -PS1=""$C_$COLOR_USER$_C"%n"$C_$COLOR_AROB$_C"@"$C_$COLOR_HOST$_C"%m"$C_$VOID$_C" ("$C_$COLOR_TERM$_C"%y"$C_$VOID$_C") ["$C_$COLOR_PATH$_C"%(!.%d.%(5~:.../:)%4~)"$C_$VOID$_C"]"${LD_PRELOAD:t:s/lib//:r}" "$C_$COLOR_HIST$_C"%h"$C_$COLOR_DIES$_C"%#"$C_$VOID$_C" " - -# Prompt level 2 -PS2="%{%}%B%_%b%{%}%B>%b%{%} " - -# Prompt level 3 -PS3="?# " - -# Prompt level 4 -PS4="+%N:%i> " - -# Prompt de droite, pour l'heure et le code d'erreur de la dernière commande -RPS1="%(?;;"$C_$COLOR_ERRR$_C"%?"$C_$VOID$_C") "$C_$COLOR_DATE$_C"%D{%H:%M:%S %d/%m/%Y}"$C_$VOID$_C"" - -# Ultime : prompt de correction :-) -SPROMPT="zsh: $C_$BLUE$_C%B'%R'%b$C_$VOID$_C ? Vous ne vouliez pas plutôt $C_$MAGENTA$_C%B'%r'%b$C_$VOID$_C ? [%BN%byae] " - diff --git a/30_Completion.zsh b/30_Completion.zsh deleted file mode 100644 index b0104b8..0000000 --- a/30_Completion.zsh +++ /dev/null @@ -1,62 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## -# Fichier de conf pour la personnalisation de la complÃtion automagique :-) -# Hugues HIEGEL -# jeu mar 3 10:00:44 CET 2005 - -autoload -U compinit 2> /dev/null -compinit -i - -## Affiche le menu de sÃlection si au moins 2 entrÃes sont possibles -zstyle ':completion:*' menu select=2 -## Utilise les couleurs définies avec dircolors -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} - -# Premiers essais... -#_ssh_hosts=(${(o)${${(M)${(f)"$(<~/.ssh/config)"}##host*}/host /}%% *}) -#zstyle ':completion:*:*:ssh,scp:*' hosts $_ssh_hosts -#zstyle ':completion:*:(ssh|scp):*:my-accounts' hosts ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} - - -# http://www.michael-prokop.at/computer/config/.zsh/zsh_completition - -zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' -zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd' -zstyle ':completion:*:kill:*' insert-ids single -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:kill:*' force-list always -#zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' - -# ssh/scp-completion -zstyle ':completion:*:scp:*' tag-order \ - 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *' -zstyle ':completion:*:scp:*' group-order \ - users files all-files hosts-domain hosts-host hosts-ipaddr -zstyle ':completion:*:ssh:*' tag-order \ - users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *' -zstyle ':completion:*:ssh:*' group-order \ - hosts-domain hosts-host users hosts-ipaddr -zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \ - '*.*' loopback localhost -zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \ - '<->.<->.<->.<->' '^*.*' '*@*' -zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \ - '^<->.<->.<->.<->' '127.0.0.<->' -zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \ - adm bin daemon halt lp named shutdown sync -zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=( - ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \ - /dev/null)"}%%[# ]*}//,/ } - ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*} - ${${${(M)${(s:# :)${(zj:# :)${(Lf)"$([[ -f ~/.ssh/config ]] && <~/.ssh/config)"}%%\#*}}##host(|name) *}#host(|name) }/\*} - )' -# ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} - -zstyle -e ':completion:*:quilt:*' command 'quilt help|tail -n +4|head -6' diff --git a/40_KeyBindings.zsh b/40_KeyBindings.zsh deleted file mode 100644 index c92a42b..0000000 --- a/40_KeyBindings.zsh +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/zsh -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -## Key bindings -# -# Lancez un chtit bindkey dans votre zsh pour voir... -# - -bindkey "[3~" delete-char # delete -bindkey "[2~" overwrite-mode # insert -bindkey "" up-line-or-history # up -bindkey "" down-line-or-history # down -bindkey "" history-search-backward # META-up -bindkey "" history-search-forward # META-down -bindkey "" forward-word # ESC right -bindkey "" backward-word # ESC left -bindkey "[3~" kill-region # ESC del - -# Pratique pour rehasher rapidement -bindkey -s "r" "  rehash\n" -# Exécute la commande ``rt'' qui me permet de nettoyer toutes les saletés -bindkey -s "R" "  rt\n" - -test $TERM = "rxvt" -o $TERM = "xterm" -o $TERM = "aterm" && -{ - bindkey "[1~" beginning-of-line # home - bindkey "[4~" end-of-line # end-of-line - bindkey "Oc" forward-word # CTRL right - bindkey "Od" backward-word # CTRL left - bindkey "[3$" vi-set-buffer # SHIFT del - bindkey "Oa" history-search-backward # CTRL UP - bindkey "Ob" history-search-forward # CTRL DOWN -} -# (gnome-terminal) -test $TERM = "xterm" && -{ - bindkey "OH" beginning-of-line # home - bindkey "OF" end-of-line # end-of-line -} -#bindkey "\C-t" gosmacs-transpose-chars # J, ca c'est un truc pour toi -# ne pas oublier de s'en servir : -# vi-match-bracket est sur ^X^B par defaut -# npo : quote-region est sur ESC-" par defaut -# npo : which-command est sur ESC-? par defaut -# Lancez ``bindkey'' pour en savoir plus !! - -#!/bin/zsh - -## Résultat d'un ``bindkey'' - -bindkey "#" set-mark-command -bindkey "^A" beginning-of-line -bindkey "^B" backward-char -bindkey "^D" delete-char-or-list -bindkey "^E" end-of-line -bindkey "^F" forward-char -bindkey "^G" send-break -bindkey "^H" backward-delete-char -bindkey "^I" expand-or-complete -bindkey "^J" accept-line -bindkey "^K" kill-line -bindkey "^L" clear-screen -bindkey "^M" accept-line -bindkey "^N" down-line-or-history -bindkey "^O" accept-line-and-down-history -bindkey "^P" up-line-or-history -bindkey "^Q" push-line -bindkey "^R" history-incremental-search-backward -bindkey "^S" history-incremental-search-forward -bindkey "^T" transpose-chars -bindkey "^U" kill-whole-line -bindkey "^V" quoted-insert -bindkey "^W" backward-kill-word -bindkey "^X^B" vi-match-bracket -bindkey "^X^F" vi-find-next-char -bindkey "^X^J" vi-join -bindkey "^X^K" kill-buffer -bindkey "^X^N" infer-next-history -bindkey "^X^O" overwrite-mode -bindkey "^X^R" _read_comp -bindkey "^X^U" undo -bindkey "^X^V" vi-cmd-mode -bindkey "^X^X" exchange-point-and-mark -bindkey "^X*" expand-word -bindkey "^X=" what-cursor-position -bindkey "^X?" _complete_debug -bindkey "^XC" _correct_filename -bindkey "^XG" list-expand -bindkey "^Xa" _expand_alias -bindkey "^Xc" _correct_word -bindkey "^Xd" _list_expansions -bindkey "^Xe" _expand_word -bindkey "^Xg" list-expand -bindkey "^Xh" _complete_help -bindkey "^Xm" _most_recent_file -bindkey "^Xn" _next_tags -bindkey "^Xr" history-incremental-search-backward -bindkey "^Xs" history-incremental-search-forward -bindkey "^Xt" _complete_tag -bindkey "^Xu" undo -bindkey "^X~" _bash_list-choices -bindkey "^Y" yank -bindkey "^D" list-choices -bindkey "^G" send-break -bindkey "^H" backward-kill-word -bindkey "^I" self-insert-unmeta -bindkey "^J" self-insert-unmeta -bindkey "^L" clear-screen -bindkey "^M" self-insert-unmeta -bindkey "[3~" kill-region -bindkey "" history-search-backward -bindkey "" history-search-forward -bindkey "" forward-word -bindkey "" backward-word -bindkey "^_" copy-prev-word -bindkey " " magic-space -bindkey "!" expand-history -bindkey "\"" quote-region -bindkey "\$" spell-word -bindkey "'" quote-line #'" -bindkey "," _history-complete-newer -bindkey "-" neg-argument -bindkey "." insert-last-word -bindkey "/" _history-complete-older -bindkey "0" digit-argument -bindkey "1" digit-argument -bindkey "2" digit-argument -bindkey "3" digit-argument -bindkey "4" digit-argument -bindkey "5" digit-argument -bindkey "6" digit-argument -bindkey "7" digit-argument -bindkey "8" digit-argument -bindkey "9" digit-argument -bindkey "<" beginning-of-buffer-or-history -bindkey ">" end-of-buffer-or-history -bindkey "?" which-command -bindkey "A" accept-and-hold -bindkey "B" backward-word -bindkey "C" capitalize-word -bindkey "D" kill-word -bindkey "F" forward-word -bindkey "G" get-line -bindkey "H" run-help -bindkey "L" down-case-word -bindkey "N" history-search-forward -bindkey "OA" up-line-or-history -bindkey "OB" down-line-or-history -bindkey "OC" forward-char -bindkey "OD" backward-char -bindkey "P" history-search-backward -bindkey "Q" push-line -bindkey "S" spell-word -bindkey "T" transpose-words -bindkey "U" up-case-word -bindkey "W" copy-region-as-kill -bindkey "[1~" beginning-of-line -bindkey "[2~" overwrite-mode -bindkey "[3~" delete-char -bindkey "[4~" end-of-line -bindkey "[5~" history-beginning-search-backward-end -bindkey "[6~" history-beginning-search-forward-end -bindkey "" up-line-or-history -bindkey "" down-line-or-history -bindkey "" forward-char -bindkey "" backward-char -bindkey "_" insert-last-word -bindkey "a" accept-and-hold -bindkey "b" backward-word -bindkey "c" capitalize-word -bindkey "d" kill-word -bindkey "f" forward-word -bindkey "g" get-line -bindkey "h" run-help -bindkey "l" down-case-word -bindkey "n" history-search-forward -bindkey "p" history-search-backward -bindkey "q" push-line -bindkey "s" spell-word -bindkey "t" transpose-words -bindkey "u" up-case-word -bindkey "w" copy-region-as-kill -bindkey "x" execute-named-cmd -bindkey "y" yank-pop -bindkey "z" execute-last-named-cmd -bindkey "|" vi-goto-column -bindkey "~" _bash_complete-word -bindkey "^?" backward-kill-word -bindkey "^\" up-history -bindkey "^\" down-history -bindkey "^\" forward-char -bindkey "^\" backward-char -bindkey "^_" undo -bindkey " "-"~" self-insert -bindkey "" backward-delete-char -bindkey "\M-^@"-"\M-" self-insert - -# Raccourcis pour les todo : funny :) -bindkey -s "t" "  todo\n" -bindkey -s "T" "  todo all -c\n" - -bindkey -s "é" " 2>/dev/null " -bindkey -s "2" " 2>&1 " - -bindkey -s "m" "  make\n" -bindkey -s "M" "make " - -bindkey -s "l" "  l\n" -#bindkey -s "L" "  la\n" - -bindkey -s " " "\\\\ " diff --git a/50_Aliases.zsh b/50_Aliases.zsh new file mode 100644 index 0000000..1818c4b --- /dev/null +++ b/50_Aliases.zsh @@ -0,0 +1,65 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## +alias a='alias' + +a -g ¬ISO='LC_ALL=fr_FR' +a -g ¬UTF='LC_ALL=fr_FR.UTF-8' + +a una=unalias + +cmd_exists emacsclient && a e='emacsclient' +cmd_exists emacs && a ne='emacs -nw' + +cmd_exists vim && a v='vim' + +cmd_exists eject && a close='eject -t' + +a rm='rm -i' +a mv='mv -i' +a cp && una cp ## Dé-assigne les alias de ``cp'' +autoload zmv +a mmv='noglob zmv -W' + +normal_user && cmd_exists apt-get && a apt-get='sudo apt-get' + +a rt='find .* * -prune -type f \( -name "*~" -o -name ".*~" -o -name "#*#" \) -exec rm -vf \{\} \;' + +a eg=egrep + +a hg='< $HISTFILE cat -n | grep' +##'hc' stands for something like 'fc' and 'hg'## +a hc='history 0| grep' +a lg='ls -lap | grep' + +a s='cd ..' +a so='cd ${OLDPWD}' + +a x=exit + +a ls='ls -F --color=always' +a l='ls -lh' +a ll='ls -l' +a la='ls -la' +a lc='ls -c' +a lm='ls -ma' +a lc1='\ls -c1' + +cmd_exists dict && a definition='dict -h dict.org' +cmd_exists dict && a traduction='dict -h localhost -P-' + +cmd_exists dosbox && a dosbox='dosbox -c "mount c \"`pwd`\"" -c "mount d /cdrom -t cdrom" -c "c:" ' +cmd_exists emacss && a gnus='emacs -f gnus' + +#a make='make -j' + +## Suffixes Aliases +cmd_exists editdiff && a -s patch=editdiff +a -s c=$EDITOR +a -s h=$EDITOR diff --git a/50_Hashes.zsh b/50_Hashes.zsh deleted file mode 100644 index 4564729..0000000 --- a/50_Hashes.zsh +++ /dev/null @@ -1,9 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## diff --git a/51_Hashes.zsh b/51_Hashes.zsh new file mode 100644 index 0000000..4dd4cf9 --- /dev/null +++ b/51_Hashes.zsh @@ -0,0 +1,9 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## diff --git a/60_Completion.zsh b/60_Completion.zsh new file mode 100644 index 0000000..63bffa5 --- /dev/null +++ b/60_Completion.zsh @@ -0,0 +1,62 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## +# Fichier de conf pour la personnalisation de la complÃtion automagique :-) +# Hugues HIEGEL +# jeu mar 3 10:00:44 CET 2005 + +autoload -U compinit 2> /dev/null +compinit -i + +## Affiche le menu de sÃlection si au moins 2 entrÃes sont possibles +zstyle ':completion:*' menu select=2 +## Utilise les couleurs définies avec dircolors +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} + +# Premiers essais... +#_ssh_hosts=(${(o)${${(M)${(f)"$(<~/.ssh/config)"}##host*}/host /}%% *}) +#zstyle ':completion:*:*:ssh,scp:*' hosts $_ssh_hosts +#zstyle ':completion:*:(ssh|scp):*:my-accounts' hosts ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} + + +# http://www.michael-prokop.at/computer/config/.zsh/zsh_completition + +zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' +zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd' +zstyle ':completion:*:kill:*' insert-ids single +zstyle ':completion:*:*:kill:*' menu yes select +zstyle ':completion:*:kill:*' force-list always +#zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' + +# ssh/scp-completion +zstyle ':completion:*:scp:*' tag-order \ + 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *' +zstyle ':completion:*:scp:*' group-order \ + users files all-files hosts-domain hosts-host hosts-ipaddr +zstyle ':completion:*:ssh:*' tag-order \ + users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *' +zstyle ':completion:*:ssh:*' group-order \ + hosts-domain hosts-host users hosts-ipaddr +zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \ + '*.*' loopback localhost +zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \ + '<->.<->.<->.<->' '^*.*' '*@*' +zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \ + '^<->.<->.<->.<->' '127.0.0.<->' +zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \ + adm bin daemon halt lp named shutdown sync +zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=( + ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \ + /dev/null)"}%%[# ]*}//,/ } + ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*} + ${${${(M)${(s:# :)${(zj:# :)${(Lf)"$([[ -f ~/.ssh/config ]] && <~/.ssh/config)"}%%\#*}}##host(|name) *}#host(|name) }/\*} + )' +# ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} + +zstyle -e ':completion:*:quilt:*' command 'quilt help|tail -n +4|head -6' diff --git a/70_Aliases.zsh b/70_Aliases.zsh deleted file mode 100644 index 40460db..0000000 --- a/70_Aliases.zsh +++ /dev/null @@ -1,70 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## -alias a='alias' - -a -g DEVNULL='>/dev/null 2>&1' -a -g NOTROOT='[ "`whoami`" != "root" ] && ' - -a -g ASCII='LC_ALL=fr_FR' -a -g UNICODE='LC_ALL=fr_FR.UTF-8' - -a una=unalias - -a e='emacsclient' -a ne='emacs -nw' - -a v='vim' - -a close='eject -t' - -a rm='rm -i' -a mv='mv -i' -autoload zmv -a mmv='noglob zmv -W' - -NOTROOT which apt-get DEVNULL && a apt-get='sudo apt-get' - -a rt='find . -type f \( -name "*~" -o -name ".*~" -o -name "#*#" \) -exec rm -vf \{\} \;' - -a eg=egrep - -a hg='< $HISTFILE cat -n | grep' -##'hc' stands for something like 'fc' and 'hg'## -a hc='history 0| grep' -a lg='ls -lap | grep' - -a s='cd ..' -a so='cd ${OLDPWD}' - -a x=exit - -a ls='ls -F --color=always' -a l='ls -lh' -a ll='ls -l' -a la='ls -la' -a lc='ls -c' -a lm='ls -ma' -a lc1='\ls -c1' - -a definition='dict -h dict.org' -a traduction='dict -h localhost -P-' - -a dosbox='dosbox -c "mount c \"`pwd`\"" -c "mount d /cdrom -t cdrom" -c "c:" ' -a gnus='emacs -f gnus' - -#a make='make -j' - -# Unicode-uncompliant -#a mutt='ASCII mutt' - -## Suffixes Aliases -a -s patch=editdiff -a -s c=$EDITOR -a -s h=$EDITOR diff --git a/80_Functions.zsh b/80_Functions.zsh deleted file mode 100644 index dd6de32..0000000 --- a/80_Functions.zsh +++ /dev/null @@ -1,43 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -term_title() -{ - [[ -t 1 ]] && - case $TERM in - sun-cmd) - print -Pn "\e]l%n@%m %~$1\e\\" ;; - *xterm*|rxvt*|(k|E|dt)term|gnome-terminal) - print -Pn "\e]0;%n@%m (%l) %~$1\a" ;; - esac -} - -_chpwd() -{ - term_title -} - -chpwd() -{ - _chpwd - which todo > /dev/null 2>&1 && todo -} - -precmd () -{ -## [[ -t 1 ]] && -# print -nP "%(?,,%{%}Foirage n°%{%}%?\n)%{%}" - _chpwd -} - -preexec () -{ - term_title " $1" -} diff --git a/80_KeyBindings.zsh b/80_KeyBindings.zsh new file mode 100644 index 0000000..e69de29 diff --git a/85_Debug.zsh b/85_Debug.zsh deleted file mode 100644 index 8fb3c21..0000000 --- a/85_Debug.zsh +++ /dev/null @@ -1,50 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -cd_back() { -# for folder in $@ -# do -# cd $(echo $folder | sed "s:[^/]\+:..:g") -# done - cd $1 "" -} - -ldd() -{ - #LDD=$(dlocate ldd | egrep "bin/ldd$" | head -n1 | cut -d' ' -f2) - LDD=/usr/bin/ldd - $LDD $@ | sed "s/\(.*local.*\)/\1/;s/\(.*not found.*\)/\1/" | tr -d ' ' -} - -exports() -{ - if ( [ $# -ne 0 ] ) - then - if ( [ $1 != "-" ] ) - then - export LD_LIBRARY_PATH=${1}/lib - export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig - export ACLOCAL_FLAGS="-I ${1}/share/aclocal" - else - unset LD_LIBRARY_PATH - unset PKG_CONFIG_PATH - unset ACLOCAL_FLAGS - fi - fi - - for i in LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL_FLAGS - do - if ( [ ! -z ${(P)i} ] ) ; then - echo "$i: "${(P)i}"" - else - echo "$i is unset." - fi - done -} diff --git a/90_DevelUtils.zsh b/90_DevelUtils.zsh new file mode 100644 index 0000000..37290a0 --- /dev/null +++ b/90_DevelUtils.zsh @@ -0,0 +1,50 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +cd_back() { +# for folder in $@ +# do +# cd $(echo $folder | sed "s:[^/]\+:..:g") +# done + cd $1 "" +} + +ldd() +{ + #LDD=$(dlocate ldd | egrep "bin/ldd$" | head -n1 | cut -d' ' -f2) + LDD=/usr/bin/ldd + $LDD $@ | sed "s/\(.*local.*\)/\1/;s/\(.*not found.*\)/\1/" | tr -d ' ' +} + +exports() +{ + if ( [ $# -ne 0 ] ) + then + if ( [ $1 != "-" ] ) + then + export LD_LIBRARY_PATH=${1}/lib + export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig + export ACLOCAL_FLAGS="-I ${1}/share/aclocal" + else + unset LD_LIBRARY_PATH + unset PKG_CONFIG_PATH + unset ACLOCAL_FLAGS + fi + fi + + for i in LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL_FLAGS + do + if ( [ ! -z ${(P)i} ] ) ; then + echo "$i: "${(P)i}"" + else + echo "$i is unset." + fi + done +} diff --git a/99_Exec.zsh b/99_Exec.zsh new file mode 100644 index 0000000..f5af0a7 --- /dev/null +++ b/99_Exec.zsh @@ -0,0 +1,12 @@ +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +## Hop on rafraîchit le titre de la fenêtre +chpwd diff --git a/99_Start.zsh b/99_Start.zsh deleted file mode 100644 index dfc4b65..0000000 --- a/99_Start.zsh +++ /dev/null @@ -1,12 +0,0 @@ -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -## Hop on rafraîchit le titre de la fenêtre -chpwd diff --git a/host:paranoid/Aliases.zsh b/host:paranoid/Aliases.zsh deleted file mode 100644 index 330f68d..0000000 --- a/host:paranoid/Aliases.zsh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/zsh -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## - -## Paranoid specifics aliases - -a mailstats='mailstat -mo ~/.procmail/procmail.log' -a mails='mailstat -k ~/.procmail/procmail.log | egrep -v "## .*:" ; cat ~/.procmail/procmail.log >> ~/.procmail/procmail.log.old ; echo -n > ~/.procmail/procmail.log' -a junkmail='mutt -f ~/Mail/junk.gz' diff --git a/host:paranoid/Environment.zsh b/host:paranoid/Environment.zsh deleted file mode 100644 index 07f3bad..0000000 --- a/host:paranoid/Environment.zsh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/zsh -## -## Part of configuration files for Zsh 4 -## by Hugues Hiegel -## -## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS -## -## You are encouraged to use, modify, and redistribute -## these files with or without this notice. -## -#export PRINTER=Gertrude -export PRINTER=Berthe diff --git a/host:prunelle/Aliases.zsh b/host:prunelle/Aliases.zsh index 900e335..03b6b3f 100644 --- a/host:prunelle/Aliases.zsh +++ b/host:prunelle/Aliases.zsh @@ -1,7 +1,7 @@ #!/bin/zsh ## ## Part of configuration files for Zsh 4 -## by Hugues Hiegel +## by Hugues Hiegel ## ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## diff --git a/host:prunelle/Environment.zsh b/host:prunelle/Environment.zsh index b96764f..219e88e 100644 --- a/host:prunelle/Environment.zsh +++ b/host:prunelle/Environment.zsh @@ -1,7 +1,7 @@ #!/bin/zsh ## ## Part of configuration files for Zsh 4 -## by Hugues Hiegel +## by Hugues Hiegel ## ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## diff --git a/net:example.com/Environment.zsh b/net:example.com/Environment.zsh index 27997ce..a1345ef 100644 --- a/net:example.com/Environment.zsh +++ b/net:example.com/Environment.zsh @@ -1,7 +1,7 @@ #!/bin/zsh ## ## Part of configuration files for Zsh 4 -## by Hugues Hiegel +## by Hugues Hiegel ## ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## diff --git a/net:ordener.fr/Aliases.zsh b/net:ordener.fr/Aliases.zsh new file mode 100644 index 0000000..dafa07b --- /dev/null +++ b/net:ordener.fr/Aliases.zsh @@ -0,0 +1,16 @@ +#!/bin/zsh +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +## Paranoid specifics aliases + +cmd_exists mailstat && a mailstats='mailstat -mo ~/.procmail/procmail.log' +cmd_exists mailstat && a mails='mailstat -k ~/.procmail/procmail.log | egrep -v "## .*:" ; cat ~/.procmail/procmail.log >> ~/.procmail/procmail.log.old ; echo -n > ~/.procmail/procmail.log' +cmd_exists mutt && a junkmail='[ -f ~/Mail/junk.gz ] && mutt -f ~/Mail/junk.gz' diff --git a/net:ordener.fr/Environment.zsh b/net:ordener.fr/Environment.zsh new file mode 100644 index 0000000..6f220db --- /dev/null +++ b/net:ordener.fr/Environment.zsh @@ -0,0 +1,12 @@ +#!/bin/zsh +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## +#export PRINTER=Gertrude +export PRINTER=Berthe diff --git a/user:hugues/KeyBindings.zsh b/user:hugues/KeyBindings.zsh new file mode 100644 index 0000000..d47fb62 --- /dev/null +++ b/user:hugues/KeyBindings.zsh @@ -0,0 +1,219 @@ +#!/bin/zsh +## +## Part of configuration files for Zsh 4 +## by Hugues Hiegel +## +## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS +## +## You are encouraged to use, modify, and redistribute +## these files with or without this notice. +## + +## Key bindings +# +# Lancez un chtit bindkey dans votre zsh pour voir... +# + +bindkey "[3~" delete-char # delete +bindkey "[2~" overwrite-mode # insert +bindkey "" up-line-or-history # up +bindkey "" down-line-or-history # down +bindkey "" history-search-backward # META-up +bindkey "" history-search-forward # META-down +bindkey "" forward-word # ESC right +bindkey "" backward-word # ESC left +bindkey "[3~" kill-region # ESC del + +# Pratique pour rehasher rapidement +bindkey -s "r" "  rehash\n" +# Exécute la commande ``rt'' qui me permet de nettoyer toutes les saletés +bindkey -s "R" "  rt\n" + +test $TERM = "rxvt" -o $TERM = "xterm" -o $TERM = "aterm" && +{ + bindkey "[1~" beginning-of-line # home + bindkey "[4~" end-of-line # end-of-line + bindkey "Oc" forward-word # CTRL right + bindkey "Od" backward-word # CTRL left + bindkey "[3$" vi-set-buffer # SHIFT del + bindkey "Oa" history-search-backward # CTRL UP + bindkey "Ob" history-search-forward # CTRL DOWN +} +# (gnome-terminal) +test $TERM = "xterm" && +{ + bindkey "OH" beginning-of-line # home + bindkey "OF" end-of-line # end-of-line +} +#bindkey "\C-t" gosmacs-transpose-chars # J, ca c'est un truc pour toi +# ne pas oublier de s'en servir : +# vi-match-bracket est sur ^X^B par defaut +# npo : quote-region est sur ESC-" par defaut +# npo : which-command est sur ESC-? par defaut +# Lancez ``bindkey'' pour en savoir plus !! + +#!/bin/zsh + +## Résultat d'un ``bindkey'' + +bindkey "#" set-mark-command +bindkey "^A" beginning-of-line +bindkey "^B" backward-char +bindkey "^D" delete-char-or-list +bindkey "^E" end-of-line +bindkey "^F" forward-char +bindkey "^G" send-break +bindkey "^H" backward-delete-char +bindkey "^I" expand-or-complete +bindkey "^J" accept-line +bindkey "^K" kill-line +bindkey "^L" clear-screen +bindkey "^M" accept-line +bindkey "^N" down-line-or-history +bindkey "^O" accept-line-and-down-history +bindkey "^P" up-line-or-history +bindkey "^Q" push-line +bindkey "^R" history-incremental-search-backward +bindkey "^S" history-incremental-search-forward +bindkey "^T" transpose-chars +bindkey "^U" kill-whole-line +bindkey "^V" quoted-insert +bindkey "^W" backward-kill-word +bindkey "^X^B" vi-match-bracket +bindkey "^X^F" vi-find-next-char +bindkey "^X^J" vi-join +bindkey "^X^K" kill-buffer +bindkey "^X^N" infer-next-history +bindkey "^X^O" overwrite-mode +bindkey "^X^R" _read_comp +bindkey "^X^U" undo +#bindkey "^X^V" vi-cmd-mode +bindkey "^X^X" exchange-point-and-mark +bindkey "^X*" expand-word +bindkey "^X=" what-cursor-position +bindkey "^X?" _complete_debug +bindkey "^XC" _correct_filename +bindkey "^XG" list-expand +bindkey "^Xa" _expand_alias +bindkey "^Xc" _correct_word +bindkey "^Xd" _list_expansions +bindkey "^Xe" _expand_word +bindkey "^Xg" list-expand +bindkey "^Xh" _complete_help +bindkey "^Xm" _most_recent_file +bindkey "^Xn" _next_tags +bindkey "^Xr" history-incremental-search-backward +bindkey "^Xs" history-incremental-search-forward +bindkey "^Xt" _complete_tag +bindkey "^Xu" undo +bindkey "^X~" _bash_list-choices +bindkey "^Y" yank +bindkey "^D" list-choices +bindkey "^G" send-break +bindkey "^H" backward-kill-word +bindkey "^I" self-insert-unmeta +bindkey "^J" self-insert-unmeta +bindkey "^L" clear-screen +bindkey "^M" self-insert-unmeta +bindkey "[3~" kill-region +bindkey "" history-search-backward +bindkey "" history-search-forward +bindkey "" forward-word +bindkey "" backward-word +bindkey "^_" copy-prev-word +bindkey " " magic-space +bindkey "!" expand-history +bindkey "\"" quote-region +bindkey "\$" spell-word +bindkey "'" quote-line #'" +bindkey "," _history-complete-newer +bindkey "-" neg-argument +bindkey "." insert-last-word +bindkey "/" _history-complete-older +bindkey "0" digit-argument +bindkey "1" digit-argument +bindkey "2" digit-argument +bindkey "3" digit-argument +bindkey "4" digit-argument +bindkey "5" digit-argument +bindkey "6" digit-argument +bindkey "7" digit-argument +bindkey "8" digit-argument +bindkey "9" digit-argument +bindkey "<" beginning-of-buffer-or-history +bindkey ">" end-of-buffer-or-history +bindkey "?" which-command +bindkey "A" accept-and-hold +bindkey "B" backward-word +bindkey "C" capitalize-word +bindkey "D" kill-word +bindkey "F" forward-word +bindkey "G" get-line +bindkey "H" run-help +bindkey "L" down-case-word +bindkey "N" history-search-forward +bindkey "OA" up-line-or-history +bindkey "OB" down-line-or-history +bindkey "OC" forward-char +bindkey "OD" backward-char +bindkey "P" history-search-backward +bindkey "Q" push-line +bindkey "S" spell-word +bindkey "T" transpose-words +bindkey "U" up-case-word +bindkey "W" copy-region-as-kill +bindkey "[1~" beginning-of-line +bindkey "[2~" overwrite-mode +bindkey "[3~" delete-char +bindkey "[4~" end-of-line +bindkey "[5~" history-beginning-search-backward-end +bindkey "[6~" history-beginning-search-forward-end +bindkey "" up-line-or-history +bindkey "" down-line-or-history +bindkey "" forward-char +bindkey "" backward-char +bindkey "_" insert-last-word +bindkey "a" accept-and-hold +bindkey "b" backward-word +bindkey "c" capitalize-word +bindkey "d" kill-word +bindkey "f" forward-word +bindkey "g" get-line +bindkey "h" run-help +bindkey "l" down-case-word +bindkey "n" history-search-forward +bindkey "p" history-search-backward +bindkey "q" push-line +bindkey "s" spell-word +bindkey "t" transpose-words +bindkey "u" up-case-word +bindkey "w" copy-region-as-kill +bindkey "x" execute-named-cmd +bindkey "y" yank-pop +bindkey "z" execute-last-named-cmd +bindkey "|" vi-goto-column +bindkey "~" _bash_complete-word +bindkey "^?" backward-kill-word +bindkey "^\" up-history +bindkey "^\" down-history +bindkey "^\" forward-char +bindkey "^\" backward-char +bindkey "^_" undo +bindkey " "-"~" self-insert +bindkey "" backward-delete-char +bindkey "\M-^@"-"\M-" self-insert + +# Raccourcis pour les todo : funny :) +bindkey -s "t" "  todo\n" +bindkey -s "T" "  todo all -c\n" + +bindkey -s "é" " 2>/dev/null " +bindkey -s "2" " 2>&1 " + +bindkey -s "m" "  make\n" +bindkey -s "M" "make " + +bindkey -s "l" "  l\n" +#bindkey -s "L" "  la\n" + +bindkey -s " " "\\\\ " -- cgit v1.2.3