From 8fcbc0a382c6b64e016ffbaab6b67bd020633701 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Sat, 18 Apr 2009 02:43:13 +0200 Subject: [PATCH] Initial import of my old zshrc splitted up, --- zsh.d/10-prompt | 10 ++++++ zsh.d/20-setopt | 42 +++++++++++++++++++++++ zsh.d/30-history | 4 +++ zsh.d/40-path | 2 ++ zsh.d/50-alias | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++ zsh.d/51-Xalias | 26 +++++++++++++++ zsh.d/60-debian | 19 +++++++++++ zsh.d/70-completion | 13 ++++++++ zshrc | 10 ++++++ 9 files changed, 221 insertions(+) create mode 100644 zsh.d/10-prompt create mode 100644 zsh.d/20-setopt create mode 100644 zsh.d/30-history create mode 100644 zsh.d/40-path create mode 100644 zsh.d/50-alias create mode 100644 zsh.d/51-Xalias create mode 100644 zsh.d/60-debian create mode 100644 zsh.d/70-completion create mode 100644 zshrc diff --git a/zsh.d/10-prompt b/zsh.d/10-prompt new file mode 100644 index 0000000..500a276 --- /dev/null +++ b/zsh.d/10-prompt @@ -0,0 +1,10 @@ +# -*- sh -*- +prompt1="%S!%h Z%i %(?..%{%})?%?%(?..%{%}%S) L%L%s %B%n@%m:%y%b (%U%N%u $ZSH_VERSION) %B%* [%5~] %(!.#.>)%b " +prompt=$prompt1 + +if [ "$DISPLAY" != "" ]; then + #function chpwd { print -nP "\033]0;%n@%m$DISPLAY [%5~]\007" } + function precmd { print -nP "\033]0;%n@%m$DISPLAY [%5~] > $0\007" } + function preexec { print -nP "\033]0;%n@%m$DISPLAY [%5~] > $1\007" } +fi + diff --git a/zsh.d/20-setopt b/zsh.d/20-setopt new file mode 100644 index 0000000..d7413f5 --- /dev/null +++ b/zsh.d/20-setopt @@ -0,0 +1,42 @@ +# -*- sh -*- +setopt \ + APPEND_HISTORY \ + AUTO_LIST \ + AUTO_MENU \ + AUTO_PARAM_SLASH \ + NO_AUTO_PUSHD \ + AUTO_REMOVE_SLASH \ + BANG_HIST \ + NO_BASH_AUTO_LIST \ + CSH_JUNKIE_HISTORY \ + CSH_JUNKIE_LOOPS \ + NO_CSH_JUNKIE_QUOTES \ + NO_CSH_NULL_CMD \ + CSH_NULL_GLOB \ + NO_EQUALS \ + EXTENDED_HISTORY \ + NO_GLOB_COMPLETE \ + GLOB_DOTS \ + HIST_BEEP \ + HIST_EXPIRE_DUPS_FIRST \ + HIST_FIND_NO_DUPS \ + HIST_IGNORE_DUPS \ + NO_HIST_IGNORE_ALL_DUPS \ + HIST_IGNORE_SPACE \ + HIST_NO_STORE \ + HIST_REDUCE_BLANKS \ + NO_HIST_VERIFY \ + INC_APPEND_HISTORY \ + NO_INTERACTIVE_COMMENTS \ + LIST_PACKED \ + LIST_TYPES \ + MAGIC_EQUAL_SUBST \ + NO_MENU_COMPLETE \ + MULTIOS \ + NOMATCH \ + NUMERIC_GLOB_SORT \ + NO_OVERSTRIKE \ + PUSHD_IGNORE_DUPS \ + PUSHD_MINUS \ + NO_SHARE_HISTORY \ + NO_SH_FILE_EXPANSION diff --git a/zsh.d/30-history b/zsh.d/30-history new file mode 100644 index 0000000..858bc74 --- /dev/null +++ b/zsh.d/30-history @@ -0,0 +1,4 @@ +# -*- sh -*- +HISTSIZE=512 +SAVEHIST=512 +HISTFILE=$HOME/.zsh_history diff --git a/zsh.d/40-path b/zsh.d/40-path new file mode 100644 index 0000000..03088f6 --- /dev/null +++ b/zsh.d/40-path @@ -0,0 +1,2 @@ +# -*- sh -*- +export PATH=${PATH}:/home/isg/bin:/sbin:/usr/sbin:/usr/local/bin/sbin:${HOME}/bin diff --git a/zsh.d/50-alias b/zsh.d/50-alias new file mode 100644 index 0000000..4c8c655 --- /dev/null +++ b/zsh.d/50-alias @@ -0,0 +1,95 @@ +# -*- sh -*- +################# +# abe's .alias' # +################# + +### DEBUG ### + +#set -x + +### Short-Cuts ### + +alias l=less +#alias md='mkdir -p \!:1; cd \!:1' +alias nsl=nslookup +alias o='$PAGER' +alias perlv='perl -le "use \!^; print \\\$\!^::VERSION;"' +#alias q=exit +alias qu='quota -v' +#alias rm='rm -r' +alias t=touch +alias xl=xlock +alias tn=telnet +alias http='telnet \!* 80' + +alias deurl='$HOME/bin/url_decode.pl' +alias c=cat +alias cd..='cd ..' +alias -g ...=../.. +alias -g ....=../../.. +alias eg=egrep +alias g=fgrep +#alias lpr='lpr \!* ; lpq' +alias m=mutt +#alias mdh='mkdir -p \!:1; cd \!:1' +#alias \-=popd +#alias \+=pushd +#alias \-1='pushd -1' +alias \+1='pushd +1' +#alias \-2='pushd -2' +alias \+2='pushd +2' +alias \.=source +#alias ~="cd ~" +#alias /="cd ~" +alias ßh=ssh +alias ßhe=sshe +alias mx=nslookup -sil -q=mx +alias ns=nslookup -sil -q=ns + + +### DOS-Aliasse und Aehnliches ### +alias cls=clear +#alias del='rm -ir' +#alias dir='ls -lF' +#alias dira='ls -alF' +alias ff='find . -name \!*' +alias quit=exit + +### Set ### +alias setvim='export EDITOR=vim VISUAL=vim' +alias setemacs='export EDITOR=emacsclient VISUAL=emacsclient' +#alias edit='$editor' +alias vt100='export TERM=vt100' + +### Gags ### +#alias y='echo "Hallo, sind wir noch wach, oder sind wir wieder auf die Y-Taste gefallen? ;-)"' + +### ls Erweiterungen ### +alias ls='ls -F --color=auto' +alias la='ls -A' +alias ll='ls -Al' +alias ld='ls -dAl' + +# Teppfihler +alias amek=make +alias nls=nsl +#alias sl=ls +alias les=less +alias lesss=less + +### Laden weiterer Aliasse + +#alias xal='source ~/.Xalias' + +#if ( -f $home/.alias.mtools ) then +# source $home/.alias.mtools +#endif +#if ( -f $home/.alias.wapua ) then +# source $home/.alias.wapua +#endif + +alias ooo=openoffice +alias OOo=openoffice +alias acs='apt-cache show' +alias acp='apt-cache policy' +alias ac/='apt-cache search' \ No newline at end of file diff --git a/zsh.d/51-Xalias b/zsh.d/51-Xalias new file mode 100644 index 0000000..c05ba48 --- /dev/null +++ b/zsh.d/51-Xalias @@ -0,0 +1,26 @@ +# -*- sh -*- +################# +# abe's .Xalias # +################# + +if [ "$DISPLAY" != "" ]; then + +### Short-Cuts ### +#alias skunkzilla='/usr/lib/jdk1.3.1/bin/java -jar /usr/src/apps/skunkdav-1.0.2.4.jar' +#alias root="xterm -T 'root@abe.i.ecos.de (bash)' -e ssh root@localhost" +#alias xmmstail="xterm -fn '-*-fixed-*-r-*-*-8-*-*-*-*-*-*-*' +sb -geom 26x19+1323+899 -e tail -f ~abe/.xmms_pls" +#alias n=netscape +#alias nets=netscape +#alias n4=communicator +#alias nets4=communicator +#alias netscape4=communicator +alias xl=xlock +alias xr=xrsh +alias xs=xssh + +### X-Aliase ### +#alias xterm='sleep 1;\xterm -geometry 80x25 -fn fixed -ut \!* &' +alias irc="$HOME/bin/ircstart.sh" +alias xv='xv \* &' + +fi \ No newline at end of file diff --git a/zsh.d/60-debian b/zsh.d/60-debian new file mode 100644 index 0000000..54fe3a0 --- /dev/null +++ b/zsh.d/60-debian @@ -0,0 +1,19 @@ +# -*- sh -*- + +export DEBFULLNAME="Axel Beckert" +export DEBUILD_LINTIAN=yes + +case `hostname -f` in + metisse.ethz.ch|tux-nslu2.ethz.ch|kiva6.ethz.ch|*.deuxchevaux.org) + export DEBEMAIL="abe@deuxchevaux.org" + export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-k95930EDE" + ;; + *.ethz.ch) + export DEBEMAIL="beckert@phys.ethz.ch" + export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-k4A2E162B" + ;; + *) + export DEBEMAIL="abe@deuxchevaux.org" + export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-k95930EDE" + ;; +esac diff --git a/zsh.d/70-completion b/zsh.d/70-completion new file mode 100644 index 0000000..e92e068 --- /dev/null +++ b/zsh.d/70-completion @@ -0,0 +1,13 @@ +# -*- sh -*- +# /usr/share/doc/zsh/examples/ssh_completion.gz +# /usr/share/doc/zsh/examples/ssh_completion2.gz +# http://zshwiki.org/CompletionExamples + +#hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*}) +#zstyle ':completion:*:hosts' hosts $hosts + +[ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} +[ -f ~/.ssh/known_hosts ] && : ${(A)ssh_known_hosts:=${${${(f)"$(<$HOME/.ssh/known_hosts)"}%%\ *}%%,*}} + +zstyle ':completion:*:*:*' hosts $ssh_config_hosts $ssh_known_hosts + diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..3d84dff --- /dev/null +++ b/zshrc @@ -0,0 +1,10 @@ +# Axel's .zshrc +# +# With ideas from grml and Freak + +setopt EXTENDED_GLOB CSH_NULL_GLOB +if [ -d ~/.zsh/zsh.d ]; then + for zshrc_snipplet in $(ls -1 ~/.zsh/zsh.d/[0-9][0-9]{,$(hostname -s)}-*[^~]) ; do + source $zshrc_snipplet + done +fi -- 2.1.4