Re-import repository after cleanup from personal stuff (see description)
I've remove too dirty or specific stuff, so that i could put this
configuration on a public repo.
Here's a copy of the initial Mercurial changelog, FWIW...
* (2012-07-14) Mikael Berthe
Reorganize all scripts
* (2012-07-14) Mikael Berthe
Add a "tools" directory
* (2012-07-14) Mikael Berthe
Don't use ^X^C as a keybinding
* (2012-07-14) Mikael Berthe
Disable ... completion for now
* (2012-07-14) Mikael Berthe
Add rehash key binding
* (2012-07-14) Mikael Berthe
Add n fix a few key bindings
* (2012-07-14) Mikael Berthe
More cleanup
Remove zshrc_compinstall
Move personnal stuff to zshrc_local
* (2012-07-14) Mikael Berthe
New commands: ...*
Previous commands .. and ... have been renamed to ,, and ,,,
* (2012-07-14) Mikael Berthe
Add WATCHFMT, move REPORTTIME to zshenv
* (2012-07-14) Mikael Berthe
Add REPORTTIME
* (2012-07-13) Mikael Berthe
Add a few useful functions
Ideas borrowed from https://github.com/whiteinge/dotfiles/blob/master/.zshrc
* (2012-07-13) Mikael Berthe
Move aliases to a new file
* (2012-07-13) Mikael Berthe
Check for zshrc_local existence
* (2012-07-13) Mikael Berthe
Cleanup vcsinfo prompt
* (2012-07-12) Mikael Berthe
Colorize time in default color prompt as well
* (2012-07-12) Mikael Berthe
Prompt: colorize time
* (2012-07-12) Mikael Berthe
Add a copy of git-prompt.sh
* (2012-07-12) Mikael Berthe
Update prompt themes
Since we do not display the mode on the first line,
let's use this place for the date/time.
* (2012-07-12) Mikael Berthe
Update prompts / new showmode
* (2012-07-12) Mikael Berthe
More showmode cleanup, part2
* (2012-07-12) Mikael Berthe
Switch showmode to using RPROMPT, part1
* (2012-07-12) Mikael Berthe
Prompt: many improvements and fixes
* (2012-07-11) Mikael Berthe
More prompt code cleanup
* (2012-07-11) Mikael Berthe
More readable prompt generation
* (2012-07-11) Mikael Berthe
Dynamic path color
* (2012-07-11) Mikael Berthe
New prompt based on Zsh' vcs_info module
* (2012-07-10) Mikael Berthe
Add git info, add a light dev2 prompt
* (2012-07-10) Mikael Berthe
Dev prompt: Improve Mercurial repository detection
* (2012-07-08) Mikael Berthe
hg prompt: Change color of unapplied patches
* (2012-07-08) Mikael Berthe
Change Mercurial prompt format
* (2012-07-08) Mikael Berthe
Try to improve showmode support. Enable it for 256 color terms.
* (2012-07-08) Mikael Berthe
Fix interaction between showmode and the new "dev" prompt
When showmode is disabled (e.g. in screen), do not display the
mode in PS1.
* (2012-07-08) Mikael Berthe
Add development prompt (HG and minimal git support)
Can be set up from the shell command line with "prompt_set_dev".
* (2012-07-08) Mikael Berthe
Ignore Vim swap files
* (2009-12-22) Mikael Berthe
Slight update zlog{in,out}
* (2009-12-22) Mikael Berthe
Add zlogin
* (2009-12-22) Mikael Berthe
Update hgignore list
* (2009-12-22) Mikael Berthe
Initial import into Mercurial
#
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
# Copyright (c) 1995 Antoine VOUILLON
# Copyright (c) 1995-1999 Farzad FARID
# Copyright (c) Mikael BERTHE, 2001-2012
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# La ligne suivante provoque parfois un message d'erreur non gênant
unalias run-help 2>/dev/null
autoload run-help
autoload -U zmv
# Protection des fichiers : rw-rw-r--
# Protection des répertoires : rwxrwxr-x
if [[ $UID -eq 0 ]]; then
umask 022
else
umask 002
fi
ulimit -c 0
# Pas de limite pour les coredump
#ulimit -c unlimited
#unlimit coredumpsize
########################
# Definition du prompt #
########################
# Chargement des variables pour les couleurs
autoload colors; colors;
# Prompt complet (date, login, tty, hostname, cwd) sur une ligne
# (Invite de commande de secours...)
export PS1="%T %B[%n:%l]%b %S%m%s:%~%# "
# Prompt complet sur 2 lignes, N&B
#export PS1="%B%~%b
#%D{%m%d %H:%M} %B[%n:%l]%b %S%m%s%# "
export PS2='%_.. > '
# Enable my Vim-like mode for supported terms
if [[ "$TERM" == "rxvt" ||
"$TERM" == "rxvt-256color" ||
"$TERM" == "rxvt-unicode" ||
"$TERM" == "rxvt-unicode-256color" ]]
then
export SHOWMODE="on"
fi
set shell=$SHELL
#cdpath=(~)
if [[ -z "$FPATH" ]]; then
if [[ -d "/usr/lib/zsh/functions" ]]; then
FPATH="/usr/lib/zsh/functions"
elif [[ -d "/usr/share/zsh/functions" ]]; then
FPATH="/usr/share/zsh/functions"
else
echo "zsh: Could not set FPATH variable: no ../zsh/functions directory"
fi
fi
# Pour configurer les couleurs créer le fichier /etc/LS_COLORS avec la
# commande "dircolors --print-database > /etc/LS_COLORS" et l'éditer.
# Taper 'man dircolors' pour plus de details
if [[ -x /usr/bin/dircolors ]]; then
if [[ -e /etc/LS_COLORS ]]; then
eval $(dircolors -b /etc/LS_COLORS)
else
eval $(dircolors -b)
fi
LS_OPTIONS=(--color=auto)
export LS_OPTIONS
fi
####################
# Options du shell #
####################
# Les noms des options sont écrits avec le souligné '_' optionnel pour
# faciliter la recherche dans la documentation de zsh.
# Options de completion. Complète les noms de commandes/fichiers avec TAB
# listes toutes les possibilités, ne beep pas, boucle entre les choix par
# appui répété sur TAB.
#setopt menu_complete
setopt auto_list
setopt list_types
setopt no_list_beep
#setopt bash_auto_list
# Correction automatique
setopt correct
unsetopt correct_all
# Autres options
# chdir « intelligent »
setopt auto_cd
# On ne modifie pas des fichiers existants avec '>' et '>>'
setopt no_clobber
unsetopt bg_nice
setopt no_flow_control
setopt no_hup
unsetopt sun_keyboard_hack
# On n'écrase pas le fichier d'historique
setopt append_history
# On autorise les commentaires
setopt interactive_comments
# Les lignes commençant par une espace ne seront pas archivées
setopt hist_ignore_space
# fc -l ne sera pas archivé
setopt hist_no_store
# Pas de doublons dans l'historique
setopt hist_ignore_dups
# Les répertoires sont automatiquement mis dans la pile (cf. pushd, popd...)
setopt auto_pushd
# ... sans doublons
setopt pushd_ignore_dups
# Affiche la valeur de retour d'un programme (si non nulle)
setopt print_exit_value
# Essaie de réduire la liste des complétions
setopt list_packed
#setopt nobeep
############################
# Historique des commandes #
############################
export SAVEHIST=4096
export HISTSIZE=4096
export HIST_EXPIRE_DUPS_FIRST
export HISTFILE=$HOME/.history
#############################
# Configuration des touches #
#############################
# Pour que la touche Alt marche dans les xterm
bindkey -e
if [[ -z ${TERM:#xterm*} || -z ${TERM:#rxvt*} || -z ${TERM:#linux*} ]]; then
stty pass8
# L'option -m empêche l'utilisation des accents (è = ESC-h, etc.)
#bindkey -me
fi
# Universelle
#bindkey '^Q' quoted-insert
bindkey '[2~' overwrite-mode # Ins
bindkey '[3~' delete-char # Suppr
bindkey '[5~' history-beginning-search-backward # PgUp
bindkey '[6~' history-beginning-search-forward # PgDn
bindkey '^[^I' reverse-menu-complete # ESC-Tab
bindkey '^Xc' copy-prev-word
bindkey '^Xf' _correct_filename
bindkey '^Xm' _most_recent_file
# Sur la console
if [[ "$TERM" == "console" || "$TERM" == "vt100" ]]; then
bindkey '^[[1~' beginning-of-line # Home
bindkey '^[[4~' end-of-line # End
fi
# Dans un xterm term=linux
if [[ -z ${TERM:#linux*} || -z ${TERM:#screen} ]]; then
bindkey '^[[H' beginning-of-line # Home
bindkey '^[[F' end-of-line # End
bindkey '[1~' beginning-of-line # Home
bindkey '[4~' end-of-line # End
fi
# Dans un xterm
if [[ -z ${TERM:#xterm*} ]]; then
bindkey '^[[H' beginning-of-line # Home
bindkey '^[[F' end-of-line # End
bindkey '[1~' beginning-of-line # Home
bindkey '[4~' end-of-line # End
fi
# Dans un rxvt
if [[ -z ${TERM:#rxvt*} ]]; then
bindkey '^[[7~' beginning-of-line # Home
bindkey '^[[8~' end-of-line # End
fi
# Sur un xterm, on differencie backspace et delete (?).
if [[ -z ${TERM:#xterm*} ]]
then
bindkey '^H' backward-delete-char # Backspace
bindkey '^?' backward-delete-char # Backspace
fi
# En combinaison avec le "keycode 22 = Backspace" du .Xmodmap pour
# faire marcher le backspace dans Netscape
stty erase '^?'
#######################################################
# Completion, lire le man pour plus de renseignements #
#######################################################
#compctl -g '*(-/)' cd pushd
compctl -g '.*(-/) *(-/)' cd pushd
compctl -g '.*(-/) *(-/)' rmdir
compctl -g '*.Z *.z *.gz *.tgz *(-/)' zcat gunzip
compctl -g '*.Z *.z *.gz *.tgz *.tar *.bz2 *(-/)' tart tarx tar
compctl -g '*.bz2 *(-/)' bz2cat bunzip2
compctl -g '*.zip *.ZIP *.exe *.EXE *(-/)' unzip
compctl -g '*.ps *.ps.gz *(-/)' gs ghostview gv evince
compctl -g '*.tex* *.latex* *(-/)' tex latex texi2dvi
compctl -g '*.dvi *(-/)' xdvi dvips
compctl -j -P % -x 's[-] p[1]' -k signals -- kill
compctl -l '' nohup exec
compctl -u -x 's[@]' -k hosts -- finger
compctl -m info
compctl -m -g '*.1 *(-/)' man
compctl -c which where type
compctl -g '*.pdf *(-/)' evince
# Hosts completion
if [ -f ~/.ssh/config ]; then
hosts=($hosts `grep ^Host ~/.ssh/config | sed s/Host\ // | egrep -v '^\*$'`)
fi
if [ "$hosts" ]; then
zstyle ':completion:*:hosts' hosts $hosts
fi
##########
# zstyle #
##########
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' completions 1
zstyle ':completion:*' format 'Completing %B%d%b%:'
zstyle ':completion:*' glob 1
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' max-errors 2 numeric
zstyle ':completion:*' menu select=3
zstyle ':completion:*' prompt '%e erreur(s)...'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*' substitute 1
autoload -Uz compinit
compinit
# Needed for menuselect below
zmodload zsh/complist
autoload -U incremental-complete-word
zle -N incremental-complete-word
bindkey 'i' incremental-complete-word
bindkey -M menuselect '' accept-and-infer-next-history
bindkey -s '' '/'
bindkey -s '' ','
##############################
# Source configuration files #
##############################
for rc in $ZDOTDIR/zshrc.d/??-*.zrc; do
[[ -r ${rc} ]] && source "$rc"
done
unset rc
# Local configuration files
# (Other that zshrc, which is sourced from our zshrc.d scripts)
localrcfiles=($ZDOTLOCALDIR/??-*.zrc) 2> /dev/null
for rc in $localrcfiles; do
[[ -r ${rc} ]] && source "$rc"
done
unset rc localrcfiles