summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913>2005-06-16 13:00:58 +0000
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:05 +0100
commitd5c4949d114b8426e9cff64d6865d1730e94b026 (patch)
tree0542406557c34c6e4374394e6644b5475661113a
parente9a17bd9852911b02e5a40544aacdb674c103d92 (diff)
git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@116 a0e5b806-a6f9-0310-978d-cbce73f8a913
-rw-r--r--.zlogin12
-rw-r--r--00_Darwin.zsh16
-rw-r--r--00_Exports.zsh16
-rw-r--r--01_Aliases.paranoid5
-rw-r--r--01_Aliases.zsh48
-rw-r--r--02_Zsh.zsh171
-rw-r--r--03_Completion.zsh52
-rw-r--r--99_Debug.zsh48
8 files changed, 368 insertions, 0 deletions
diff --git a/.zlogin b/.zlogin
new file mode 100644
index 0000000..123d536
--- /dev/null
+++ b/.zlogin
@@ -0,0 +1,12 @@
+
+for i in {1..$COLUMNS} ; do echo -n "_" ; done
+echo
+#/usr/games/fortune\
+# ~/bdd/fortunes/fr\
+#| cowsay
+
+calendar -A0 | sed "s/^\(......\*.*\)/\1/"
+
+for i in {1..$COLUMNS} ; do echo -n "_" ; done
+echo ""
+
diff --git a/00_Darwin.zsh b/00_Darwin.zsh
new file mode 100644
index 0000000..7a89f1f
--- /dev/null
+++ b/00_Darwin.zsh
@@ -0,0 +1,16 @@
+
+if ( [ "`uname -s`" = "Darwin" ] )
+then
+ ## Fink / DarwinPorts
+
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ MANPATH=/usr/share/man
+ INFOPATH=/usr/share/info
+
+ for i in usr/X11R6 dp sw usr/local ; do
+ export PATH=$PATH:/$i/bin:/$i/sbin
+ export MANPATH=$MANPATH:/$i/share/man
+ export INFOPATH=$INFOPATH:/$i/share/info
+ done
+
+fi
diff --git a/00_Exports.zsh b/00_Exports.zsh
new file mode 100644
index 0000000..78b8970
--- /dev/null
+++ b/00_Exports.zsh
@@ -0,0 +1,16 @@
+export HISTFILE=".zsh/.history.zsh"
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/libs
+eval $(dircolors ~/.dir_colors)
+export PATH=$PATH:~/sbin:~/bin
+export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig
+#export PRINTER=Gertrude
+export PRINTER=Berthe
+export TIME_STYLE="+%Y-%b-%d %H:%M"
+export TZ="Europe/Paris"
+source ~/.keychain/$(hostname)-sh
+export PATH=$PATH:~/.pr0n
+# Set locales only if they are undefined
+export LC_ALL=${LC_ALL:-fr_FR.UTF-8}
+export LC_MESSAGES=${LC_MESSAGES:-fr_FR}
+unset LANG # Unuseful
+export MPS1="MuZzik> "
diff --git a/01_Aliases.paranoid b/01_Aliases.paranoid
new file mode 100644
index 0000000..ba6541e
--- /dev/null
+++ b/01_Aliases.paranoid
@@ -0,0 +1,5 @@
+
+## Paranoid specifics aliases
+
+a mailstat='\mailstat -o ~/.procmail/procmail.log'
+a mails='\mailstat -k ~/.procmail/procmail.log ; cat ~/.procmail/procmail.log >> ~/.procmail/procmail.log.old ; echo -n > ~/.procmail/procmail.log'
diff --git a/01_Aliases.zsh b/01_Aliases.zsh
new file mode 100644
index 0000000..e8d62d6
--- /dev/null
+++ b/01_Aliases.zsh
@@ -0,0 +1,48 @@
+alias a='alias'
+
+a una=unalias
+
+a e='emacs'
+a ne='emacs -nw'
+
+a close='eject -t'
+
+a rm='rm -i'
+a mv='mv -i'
+autoload zmv
+a mmv='noglob zmv -W'
+
+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 egrep'
+a lg='ls -lap | egrep'
+
+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'
+
+if [ -f $ZDOTDIR/*_Aliases.`hostname` ]
+then
+ source $ZDOTDIR/*_Aliases.`hostname`
+fi
diff --git a/02_Zsh.zsh b/02_Zsh.zsh
new file mode 100644
index 0000000..3e7170a
--- /dev/null
+++ b/02_Zsh.zsh
@@ -0,0 +1,171 @@
+## No more core dumps :)
+ulimit -c 0
+umask 077
+
+export BC_ENV_ARGS="-q"
+
+##chmod 700 ~/tmp
+##find ~ \( -name '#*#' -o -name '.*~' -o -name '*~' \) -exec rm -f {} \;
+
+##
+## exports && aliases
+##
+
+if [ -f ~/.zsh/.exports.zsh ]; then
+ source ~/.zsh/.exports.zsh
+fi
+
+if [ -f ~/.zsh/.aliases.zsh ]; then
+ source ~/.zsh/.aliases.zsh
+fi
+
+
+##
+## sanity
+##
+[[ -t 0 ]] && /bin/stty erase "^H" intr "^C" susp "^Z" dsusp "^Y" stop "^S" start "^Q" kill "^U" >& /dev/null
+
+
+case $SHLVL in
+ *2) CLR_SHLVL="%{%}";;
+ *3) CLR_SHLVL="%{%}";;
+ *4) CLR_SHLVL="%{%}";;
+ *5) CLR_SHLVL="%{%}";;
+ *6) CLR_SHLVL="%{%}";;
+esac
+
+
+##
+## basic setup
+##
+LOGCHECK=13
+WATCHFMT=$COLOR_BLUECLAIR"%n"$COLOR_END
+WATCHFMT=$WATCHFMT" has "$COLOR_YELLOW"%a %l from %M"
+WATCH=notme
+NULLCMD="less -f"
+WORDCHARS="*?-._[]~=&;!#$%^(){}<>" # I suppressed the '/'
+TIMEFMT="\`%J': %U user %S system %*E total (%P cpu)"
+
+HISTFILE=$ZDOTDIR/.history
+HISTSIZE=42000
+SAVEHIST=42000
+
+##
+## Prompts
+##
+# For more info on PROMPT expansion, see 'man zshmisc'
+##
+
+C_ROOT="31"
+if ( [ "$SSH_TTY" = "" ] )
+then
+ C_USER="34"
+else
+ C_USER="35"
+fi
+
+PS1="%{[%(!."$C_ROOT"."$C_USER")m%}%n%{[1;%(!."$C_ROOT"."$C_USER")m%}@%{[0;%(!."$C_ROOT"."$C_USER")m%}%m%{%} (%{%}%y%{%}) [%(!.%{["$C_ROOT"m%}%d%{%}.%{["$C_USER"m%}%(5~:../:)%4~%{%})]"${LD_PRELOAD:t:s/lib//:r}" %h%{[%(!."$C_ROOT";1."$C_USER")m%}#%{%} "
+
+RPS1="%(?;;%{%}%?%{%}) %{[0;%(!."$C_ROOT"."$C_USER")m%}%D{%a%d%b|%H:%M'%S}%{%}"
+
+PS2="%{%}%B%_%b%{%}%B>%b%{%} "
+
+SPROMPT="zsh: %{%}%B«%R»%b%{%} ? Ce ne serait pas plutôt %{%}%B«%r»%b%{%} ? [nyae] "
+
+##
+# PS3="?# "
+#
+# PS4="+%N:%i> "
+##
+
+
+##
+## Options
+##
+setopt correct
+#setopt correctall
+setopt inc_append_history
+setopt histignorealldups
+setopt histexpiredupsfirst
+setopt alwayslastprompt
+setopt always_to_end
+setopt auto_cd
+setopt _auto_list
+setopt auto_menu
+setopt auto_param_keys
+#setopt auto_param_slash
+setopt no_bg_nice
+setopt complete_aliases
+setopt hash_cmds
+setopt hash_dirs
+setopt no_hup
+setopt mail_warning
+setopt magic_equal_subst
+setopt numericglobsort
+setopt mark_dirs
+setopt no_prompt_cr
+#setopt equals
+#setopt extended_glob
+unsetopt promptcr
+
+##
+## bindkey
+##
+
+bindkey "\e[3~" delete-char # delete
+bindkey "\e[2~" overwrite-mode # insert
+bindkey "\e[A" up-line-or-history # up
+bindkey "\e[B" down-line-or-history # down
+bindkey "\e\e[C" forward-word # ESC right
+bindkey "\e\e[D" backward-word # ESC left
+bindkey "\e[5~" up-line-or-history # page up # c'est ultime
+bindkey "\e[6~" down-line-or-history # page down
+bindkey "\e\e[3~" kill-region # ESC del
+#aterm
+test $TERM = "rxvt" -o $TERM = "xterm" &&
+{
+ bindkey "\e[1~" beginning-of-line # home
+ bindkey "\e[4~" end-of-line # end-of-line
+ bindkey "\eOc" forward-word # CTRL right
+ bindkey "\eOd" backward-word # CTRL left
+ bindkey "\e[3$" vi-set-buffer # SHIFT del
+ bindkey "\eOa" history-search-backward # CTRL UP
+ bindkey "\eOb" history-search-forward # CTRL DOWN
+}
+# (gnome-terminal)
+#test $TERM = "xterm" &&
+#{
+# bindkey "\eOH" beginning-of-line # home
+# bindkey "\eOF" 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
+
+
+##
+## functions
+##
+##[[ -t 1 ]] &&
+chpwd()
+{
+ case $TERM in
+ sun-cmd) print -Pn "\e]l%n@%m %~\e\\" ;;
+ *xterm*|rxvt|(k|E|dt)term|gnome-terminal) print -Pn "\e]0;%n@%m (%l) %~\a" ;;
+ esac
+# print -P "%(/,%78>...>%/,%//)%b"
+}
+
+precmd ()
+{
+# print -nP "%(?,,%{%}Foirage n°%{%}%?\n)%{%}"
+}
+
+##
+## misc commands
+##
+chpwd
+#(/bin/rm -f ~/.saves-*) 2>/dev/null
+
diff --git a/03_Completion.zsh b/03_Completion.zsh
new file mode 100644
index 0000000..7d45035
--- /dev/null
+++ b/03_Completion.zsh
@@ -0,0 +1,52 @@
+# Fichier de conf pour la personnalisation de la complétion automagique :-)
+# Hugues HIEGEL <hugues@nullpart.net>
+# jeu mar 3 10:00:44 CET 2005
+
+autoload -U compinit 2> /dev/null
+compinit -i
+
+zstyle ':completion:*' menu select=2
+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 }:#*\**}:#*\?*}}
+
+
diff --git a/99_Debug.zsh b/99_Debug.zsh
new file mode 100644
index 0000000..9c73868
--- /dev/null
+++ b/99_Debug.zsh
@@ -0,0 +1,48 @@
+
+cd_back() {
+ for folder in $@
+ do
+ cd $(echo $folder | sed "s:[^/]\+:..:g")
+ done
+}
+
+ldd()
+{
+ LDD=$(dlocate ldd | egrep "bin/ldd$" | head -n1 | cut -d' ' -f2)
+ $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
+}
+
+precmd()
+{
+ if ( [ "$DEBUG_MODE" = "yes" ] )
+ then
+ exports
+ fi
+}
+