.zcompdump
.zcompdump.zwc
zsh-install.sh
+run
# check every 5 min for login/logout activity
LOGCHECK=300
WATCHFMT='%n %a %l from %m at %t.'
+
+# autoload wrapper - use this one instead of autoload directly
+# We need to define this function as early as this, because autoloading
+# 'is-at-least()' needs it.
+function zrcautoload() {
+ emulate -L zsh
+ setopt extended_glob
+ local fdir ffile
+ local -i ffound
+
+ ffile=$1
+ (( ffound = 0 ))
+ for fdir in ${fpath} ; do
+ [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 ))
+ done
+
+ (( ffound == 0 )) && return 1
+ if [[ $ZSH_VERSION == 3.1.<6-> || $ZSH_VERSION == <4->* ]] ; then
+ autoload -U ${ffile} || return 1
+ else
+ autoload ${ffile} || return 1
+ fi
+ return 0
+}
+# Load is-at-least() for more precise version checks Note that this test
+# will *always* fail, if the is-at-least function could not be marked
+# for autoloading. But is-at-least exists since Fri Feb 11 19:46:46 2000
+# +0000, so if you really have an older zsh you really want to upgrade.
+zrcautoload is-at-least || is-at-least() { return 1 }
+
+# Some things need to be done very early
+# the following helper functions have been taken from the grml zshrc
+# (wherever they got them from)
+# check for version/system
+# check for versions (compatibility reasons)
+is4(){
+ [[ $ZSH_VERSION == <4->* ]] && return 0
+ return 1
+}
+
+is41(){
+ [[ $ZSH_VERSION == 4.<1->* || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is42(){
+ [[ $ZSH_VERSION == 4.<2->* || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is425(){
+ [[ $ZSH_VERSION == 4.2.<5->* || $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is43(){
+ [[ $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is433(){
+ [[ $ZSH_VERSION == 4.3.<3->* || $ZSH_VERSION == 4.<4->* \
+ || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is434(){
+ [[ $ZSH_VERSION == 4.3.<4->* || $ZSH_VERSION == 4.<4->* \
+ || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+is439(){
+ [[ $ZSH_VERSION == 4.3.<9->* || $ZSH_VERSION == 4.<4->* \
+ || $ZSH_VERSION == <5->* ]] && return 0
+ return 1
+}
+
+isdarwin(){
+ [[ $OSNAME == Darwin* ]] && return 0
+ return 1
+}
+
+isfreebsd(){
+ [[ $OSNAME == FreeBSD* ]] && return 0
+ return 1
+}
+
+if ! [[ ${ZSH_VERSION} == 3.1.<7->* \
+ || ${ZSH_VERSION} == 3.<2->.<->* \
+ || ${ZSH_VERSION} == <4->.<->* ]] ; then
+
+ printf '-!-\n'
+ printf '-!- In this configuration we try to make use of features, that only\n'
+ printf '-!- require version 3.1.7 of the shell; That way this setup can be\n'
+ printf '-!- used with a wide range of zsh versions, while using fairly\n'
+ printf '-!- advanced features in all supported versions.\n'
+ printf '-!-\n'
+ printf '-!- However, you are running zsh version %s.\n' "$ZSH_VERSION"
+ printf '-!-\n'
+ printf '-!- While this *may* work, it might as well fail.\n'
+ printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n'
+ printf '-!-\n'
+ printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n'
+ printf '-!- If it does today, you'\''ve been lucky.\n'
+ printf '-!-\n'
+ printf '-!- Ye been warned!\n'
+ printf '-!-\n'
+
+ function zstyle() { : }
+fi
+
+for paths in "$fpath[@]"; do
+ for func in "$paths"/*(N:t); do
+ zrcautoload $func
+ done
+done
+unset paths
--- /dev/null
+# -*- sh -*-
+
+# Update terminfo
+__() {
+ local terminfo
+ local termpath
+ if which tic >/dev/null; then
+ for terminfo in $ZSH/terminfo/*.terminfo(.N); do
+ # We assume that the file is named appropriately for this to work
+ termpath=~/.terminfo/${(@)${terminfo##*/}[1]}/${${terminfo##*/}%%.terminfo}
+ if [[ ! -e $termpath ]] || [[ $terminfo -nt $termpath ]]; then
+ TERMINFO=~/.terminfo tic $terminfo
+ fi
+ done
+ fi
+} && __
+
+# Update TERM if we have LC__ORIGINALTERM variable
+# Also, try a sensible term where we have terminfo stuff
+autoload -U colors zsh/terminfo zsh/termcap
+__() {
+ local term
+ local colors
+ for term in $LC__ORIGINALTERM $TERM ${TERM/-256color} xterm-256color xterm; do
+ TERM=$term 2> /dev/null
+ if (( ${terminfo[colors]:-0} >= 8 )) || \
+ (zmodload zsh/termcap 2> /dev/null) && \
+ (( ${termcap[Co]:-0} >= 8)); then
+ colors
+ break
+ fi
+ done
+ unset LC__ORIGINALTERM
+ export TERM
+ alias sudo="TERM=xterm command sudo"
+} && __
fi
}
-
normal_user ()
{
if [ -e /etc/login.defs ]; then
! normal_user
}
-chpwd()
+_jj_chpwd()
{
if ( cmd_exists git && test -d .git ); then
# Shows tracked branches and modified files
fi
}
-# Taken from oh-my-zsh
-dirpersiststore () {
- dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' >| $zdirstore
-}
-
-dirpersistrestore () {
- if [ -f $zdirstore ]; then
- source $zdirstore
- fi
-}
-
-zsh_stats() {
- history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
-}
-
-_jj_ssh() {
- # TERM is one of the variables that is usually allowed to be
- # transmitted to the remote session. The remote host should have the
- # appropriate termcap or terminfo file to handle the TERM you
- # provided. When connecting to random hosts, this may not be the
- # case if your TERM is somewhat special. A good fallback is
- # xterm. Most terminals are compatible with xterm and all hosts have
- # a termcap or terminfo file to handle xterm. Therefore, for some
- # values of TERM, we fallback to xterm.
- #
- # Now, you may connect to a host where your current TERM is fully
- # supported and you will get xterm instead (which means 8 base
- # colors only). There is no clean solution for this. You may want to
- # reexport the appropriate TERM when logged on the remote host or
- # use commands like this: ssh -t XXXXX env TERM=$TERM emacsclient -t
- # -c
- #
- # If the remote host uses the same zshrc than this one, there is
- # something in `$ZSH/rc/00-terminfo.zsh` to restore the appropriate
- # terminal (saved in `LC__ORIGINALTERM`).
- #
- # The problem is quite similar for LANG and LC_MESSAGES. We reset
- # them to C to avoid any problem with hosts not having your locally
- # installed locales. See this post for more details on this:
- # http://vincent.bernat.im/en/blog/2011-zsh-zshrc.html
- #
- # Also, when the same ZSH configuration is used on the remote host,
- # the locale is reset with the help of 12-Locale.zsh
- case "$TERM" in
- rxvt-256color|rxvt-unicode*)
- LC__ORIGINALTERM=$TERM TERM=xterm LANG=C LC_MESSAGES=C command ssh "$@"
- ;;
- *)
- LANG=C LC_MESSAGES=C command ssh "$@"
- ;;
- esac
-}
-
-_jj_first_non_optional_arg() {
- local args
- args=( "$@" )
- args=( ${(R)args:#-*} )
- print -- $args[1]
-}
+if is434 ; then
+ add-zsh-hook chpwd _jj_chpwd
+else
+ function chpwd() {
+ _jj_chpwd
+ }
+fi
-# Alter window title
-_jj_title () {
- [ -t 1 ] || return
- emulate -L zsh
- local title
- title=${@//[^[:alnum:]\/>< ._~:=?@-]/ }
- case $TERM in
- screen*)
- print -n "\ek$title\e\\"
- print -n "\e]1;$title\a"
- print -n "\e]2;$title\a"
- ;;
- rxvt*|xterm*)
- print -n "\e]1;$title\a"
- print -n "\e]2;$title\a"
- ;;
- esac
-}
+# Taken from oh-my-zsh
+if is434; then
+ function dirpersiststore () {
+ dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' >| $zdirstore
+ }
+ add-zsh-hook zshexit dirpersiststore
-ssh() {
- _jj_title $(_jj_first_non_optional_arg "$@")
- _jj_ssh "$@"
-}
+ function dirpersistrestore () {
+ if [ -f $zdirstore ]; then
+ source $zdirstore
+ fi
+ }
+fi
export SHELL=`which zsh`
-## Colors
+## Colors
c_='\e['$color[none]";"
_c=m
C_="%{$c_"
_C="$_c%}"
unset has_termcaps
-[ $TERM = "urxvt" -o $TERM = "screen" -o $TERM = "rxvt-unicode" ] && has_termcaps="true"
+[ $TERM = "urxvt" -o $TERM = "screen" -o $TERM="screen-256color" -o $TERM = "rxvt-unicode" ] && has_termcaps="true"
T_=${has_termcaps:+$termcap[as]}
_T=${has_termcaps:+$termcap[ae]}
_t_q=${${has_termcaps:+q}:--}
_t_t=${${has_termcaps:+t}:-]}
_t_u=${${has_termcaps:+u}:-[}
-# I hate kik00l0l colorized prompts, so I'm using a way to
-# give a dominant color for each part of the prompt, each of
-# these remain still configurable one by one.
-# Take a look to set_prompt_colors for these colorizations.
-#
-# To set the dominant color I'm using this :
-#
-# - PS1_ROOT when we are root
-# - PS1_USER for normal usage
-#
-# I'm storing the resulting dominant color in $prompt_colors[generic]
-
-PS1_ROOT=${PS1_ROOT:-$color[red]}
-PS1_USER=${PS1_USER:-$color[blue]}
-PS1_YEAH="38;5;82"
-
export PATH=$PATH:~/sbin:~/local/bin
PATH=/sbin:/usr/sbin:$PATH
export MANPATH=~/man:~/local/share/man:/usr/local/share/man:$MANPATH
DIRSTACKSIZE=20
# $zdirstore is the file used to persist the stack
zdirstore=${ZDOTDIR}/var/.zdirstore
-dirpersistrestore
+is434 && dirpersistrestore
export GPG_TTY=$(tty)
(( ${+TMPDIR} )) || export TMPDIR="$HOME/tmp"
export GREP_OPTIONS='--color=auto'
+# solarized ls colors
+if [[ ! "${TERM}" == dumb ]]; then
+ export LS_COLORS='no=00:fi=00:di=36:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.xml=32:*.rdf=32:*.css=32:*.js=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;32:*~=01;32:*#=01;32:*.bak=01;33:*.BAK=01;33:*.old=01;33:*.OLD=01;33:*.org_archive=01;33:*.off=01;33:*.OFF=01;33:*.dist=01;33:*.DIST=01;33:*.orig=01;33:*.ORIG=01;33:*.swp=01;33:*.swo=01;33:*,v=01;33:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:';
+fi
+
READNULLCMD=${PAGER}
NULLCMD=${PAGER}
# If its installed - use lesspipe
[ -x /bin/lesspipe ] && eval $(lesspipe)
+
+## Use a default width of 80 for manpages for more convenient reading
+export MANWIDTH=${MANWIDTH:-80}
+
+[[ -f "$HOME/.local/share/mc/skins/solarized.ini" ]] && export MC_SKIN="solarized"
# gather version control information for inclusion in a prompt
# we will only be using one variable, so let the code know now.
-autoload -Uz vcs_info && vcs_info
-zstyle ':vcs_info:*' max-exports 1
-zstyle ':vcs_info:*' disable cdv darcs mtn tla hg
-zstyle ':vcs_info:*' use-prompt-escapes
-zstyle ':vcs_info:*' use_simple
+if is439 && zrcautoload vcs_info && vcs_info; then
+ zstyle ':vcs_info:*' max-exports 1
+ zstyle ':vcs_info:*' disable cdv darcs mtn tla hg
+ zstyle ':vcs_info:*' use-prompt-escapes
+ zstyle ':vcs_info:*' use_simple
-# change vcs_info formats for the prompt
-if [[ "$TERM" == dumb ]] ; then
- zstyle ':vcs_info:*' actionformats "(%s%)-[%b|%a] "
- zstyle ':vcs_info:*' formats "(%s%)-[%b] "
-else
- # these are the same, just with a lot of colours:
-# zstyle ':vcs_info:*' actionformats "$%s${PR_YELLOW})${PR_CYAN}-${PR_YELLOW}[${PR_GREEN}%b${PR_YELLOW}|${PR_RED}%a${PR_YELLOW}]${PR_NO_COLOUR}"
- zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b%{$fg[red]%}:%{$fg[yellow]%}%r"
- zstyle ':vcs_info:git*' formats "%{$fg[yellow]%}%s %{$reset_color%} %{$fg[green]%}%b%{$reset_color%}%m%u%c%{$reset_color%} "
- zstyle ':vcs_info:git*' actionformats "%{$fg[yellow]%}%s%{$reset_color%} %{$fg[green]%}%b%{$reset_color%} $fg[red]%}(%a)%{$reset_color%} %m%u%c%{$reset_color%} "
+ # change vcs_info formats for the prompt
+ if [[ "$TERM" == dumb ]]; then
+ zstyle ':vcs_info:*' actionformats "(%s%)-[%b|%a] "
+ zstyle ':vcs_info:*' formats "(%s%)-[%b] "
+ else
+ # these are the same, just with a lot of colours:
+ # zstyle ':vcs_info:*' actionformats "$%s${PR_YELLOW})${PR_CYAN}-${PR_YELLOW}[${PR_GREEN}%b${PR_YELLOW}|${PR_RED}%a${PR_YELLOW}]${PR_NO_COLOUR}"
+ zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b%{$fg[red]%}:%{$fg[yellow]%}%r"
+ zstyle ':vcs_info:git*' formats "%{$fg[yellow]%}%s %{$reset_color%} %{$fg[green]%}%b%{$reset_color%}%m%u%c%{$reset_color%} "
+ zstyle ':vcs_info:git*' actionformats "%{$fg[yellow]%}%s%{$reset_color%} %{$fg[green]%}%b%{$reset_color%} $fg[red]%}(%a)%{$reset_color%} %m%u%c%{$reset_color%} "
+ fi
fi
PR_BARLENGTH=0
# Use zsh syntax highlighting
#
-if [ -d $ZDOTDIR/zsh-syntax-highlighting ]; then
- ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
- source $ZDOTDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-fi
+if is434; then
+ if [ -d $ZDOTDIR/zsh-syntax-highlighting ]; then
+ ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
+ source $ZDOTDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+ fi
-ZSH_HIGHLIGHT_STYLES[default]="none"
+ ZSH_HIGHLIGHT_STYLES[default]="none"
-ZSH_HIGHLIGHT_STYLES[assign]="none"
+ ZSH_HIGHLIGHT_STYLES[assign]="none"
-ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]="fg=yellow,bold"
-ZSH_HIGHLIGHT_STYLES[back-quoted-argument]="green"
+ ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]="fg=yellow,bold"
+ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]="green"
-ZSH_HIGHLIGHT_STYLES[bracket-error]="fg=red,bold"
-ZSH_HIGHLIGHT_STYLES[bracket-level-1]="fg=yellow,bold"
-ZSH_HIGHLIGHT_STYLES[bracket-level-2]="fg=green"
-ZSH_HIGHLIGHT_STYLES[bracket-level-3]="fg=cyan,bold"
-ZSH_HIGHLIGHT_STYLES[bracket-level-4]="fg=blue"
-ZSH_HIGHLIGHT_STYLES[bracket-level-5]="fg=magenta"
-ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]="fg=white,underline,bold"
+ ZSH_HIGHLIGHT_STYLES[bracket-error]="fg=red,bold"
+ ZSH_HIGHLIGHT_STYLES[bracket-level-1]="fg=yellow,bold"
+ ZSH_HIGHLIGHT_STYLES[bracket-level-2]="fg=green"
+ ZSH_HIGHLIGHT_STYLES[bracket-level-3]="fg=cyan,bold"
+ ZSH_HIGHLIGHT_STYLES[bracket-level-4]="fg=blue"
+ ZSH_HIGHLIGHT_STYLES[bracket-level-5]="fg=magenta"
+ ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]="fg=white,underline,bold"
-ZSH_HIGHLIGHT_STYLES[builtin]="fg=cyan,bold,underline"
-ZSH_HIGHLIGHT_STYLES[function]="fg=cyan,bold"
-ZSH_HIGHLIGHT_STYLES[alias]="fg=cyan"
-ZSH_HIGHLIGHT_STYLES[command]="fg=normal"
-ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=normal,bold"
-ZSH_HIGHLIGHT_STYLES[path]="fg=normal"
-ZSH_HIGHLIGHT_STYLES[precommand]="fg=normal,underline"
-ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=cyan,underline"
+ ZSH_HIGHLIGHT_STYLES[builtin]="fg=cyan,bold,underline"
+ ZSH_HIGHLIGHT_STYLES[function]="fg=cyan,bold"
+ ZSH_HIGHLIGHT_STYLES[alias]="fg=cyan"
+ ZSH_HIGHLIGHT_STYLES[command]="fg=normal"
+ ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=normal,bold"
+ ZSH_HIGHLIGHT_STYLES[path]="fg=normal"
+ ZSH_HIGHLIGHT_STYLES[precommand]="fg=normal,underline"
+ ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=cyan,underline"
-ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=blue"
+ ZSH_HIGHLIGHT_STYLES[history-expansion]="fg=blue"
-ZSH_HIGHLIGHT_STYLES[globbing]="fg=cyan"
+ ZSH_HIGHLIGHT_STYLES[globbing]="fg=cyan"
-ZSH_HIGHLIGHT_STYLES[commandseparator]="none"
+ ZSH_HIGHLIGHT_STYLES[commandseparator]="none"
-ZSH_HIGHLIGHT_STYLES[cursor]="bold"
+ ZSH_HIGHLIGHT_STYLES[cursor]="bold"
-ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="green"
-ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="yellow"
-ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=green,bold"
-ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=yellow,bold"
-ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]="fg=blue,bold"
+ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="green"
+ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="yellow"
+ ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=green,bold"
+ ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=yellow,bold"
+ ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]="fg=blue,bold"
-ZSH_HIGHLIGHT_STYLES[root]="standout"
+ ZSH_HIGHLIGHT_STYLES[root]="standout"
-ZSH_HIGHLIGHT_STYLES[unknown-token]="fg=red,bold"
+ ZSH_HIGHLIGHT_STYLES[unknown-token]="fg=red,bold"
+fi
# set-local-history zle binding. It is also possible to create a zle
# widget that will make some commands ignore imported commands, and some
# include them.
-SetOPT SHARE_HISTORY
+is4 && SetOPT SHARE_HISTORY
# Save each command's beginning timestamp (in seconds since the epoch)
# and the duration (in seconds) to the history file.
# may be modified if completion is called from a user-defined widget.
UnsetOPT LIST_BEEP
+# Remove any right prompt from display when accepting a command line.
+# This may be useful with terminals with other cut/paste methods.
+is41 && SetOPT TRANSIENT_RPROMPT
+
+unfunction -m SetOPT
+unfunction -m UnsetOPT
+unfunction -m SetOPTifExists
# -*- mode: sh;-*-
# default switches
-alias ls='command ls -AF --color=auto'
+if ls --help 2>/dev/null | grep -q GNU; then
+ alias ls='command ls -AF --color=auto'
+elif isdarwin || isfreebsd; then
+ alias ls='command ls -AF -G'
+fi
+
alias lsbig='command ls -flh *(.OL[1,10])' # display the biggest files
alias lssmall='command ls -Srl *(.oL[1,10])' # display the smallest files
alias lsnew='command ls -rl *(D.om[1,10])' # display the newest files
alias logout='noglob logout'
+# want to trace a shell function? ztrace $FUNCTIONNAME and there it goes.
+alias ztrace='typeset -f -t'
+alias zuntrace='typeset -f +t'
+
# convenient abbreviations
alias c=clear
for index ({1..9}) alias "$index"="cd -${index}"; unset index
alias mc='mc -d -U'
-alias showpkg='apt-cache showpkg'
-alias acs='apt-cache search'
-alias acw='apt-cache show'
-alias agi='LANG=C sudo aptitude install'
-alias agr='LANG=C sudo aptitude remove'
-alias agp='LANG=C sudo aptitude purge'
-alias dclean='LANG=C LC_ALL=C fakeroot debian/rules clean'
alias cpan='perl -MCPAN -e shell'
+alias rh='run-help'
# No spellchecks here
alias man='LANG=C nocorrect noglob man'
# -*- mode: sh;-*-
+# autoloads first
+autoload -Uz compinit
+autoload -U zsh/complist
+
## General completion technique
## complete as much u can ..
zstyle ':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct _approximate _prefix
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
# host completion
-[[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
-[[ -r ~/.ssh/debian_known_hosts ]] && _ssh_debian_hosts=(${${${${(f)"$(<$HOME/.ssh/debian_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_debian_hosts=()
-[[ -r /etc/ssh/ssh_known_hosts ]] && _ssh_etc_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_etc_hosts=()
-[[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
-
+if is42; then
+ [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+ [[ -r ~/.ssh/debian_known_hosts ]] && _ssh_debian_hosts=(${${${${(f)"$(<$HOME/.ssh/debian_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_debian_hosts=()
+ [[ -r /etc/ssh/ssh_known_hosts ]] && _ssh_etc_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_etc_hosts=()
+ [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+else
+ _ssh_hosts=()
+ _ssh_debian_hosts=()
+ _ssh_etc_hosts=()
+ _etc_hosts=()
+fi
hosts=(
${HOST}
"$_ssh_hosts[@]"
# ... unless we really want to.
zstyle '*' single-ignored show
+
# Dont complete CVS dirs and lost+found
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
-autoload -Uz compinit
-compinit
+compinit -d ${ZDOTDIR}/var/.zcompdump
## generic completions for programs which understand GNU long options(--help)
compdef _gnu_generic make df du gpg lintian
_debian_rules() { words=(make -f debian/rules) _make }
compdef _debian_rules debian/rules
-# git related
-compdef g=git
-compdef _git gst=git-status
-compdef _git gl=git-pull
-compdef _git gup=git-fetch
-compdef _git gp=git-push
-gdv() { git diff -w "$@" }
-compdef _git gdv=git-diff
-compdef _git gc=git-commit
-compdef _git gca=git-commit
-compdef _git gco=git-checkout
-compdef _git gr=git-remote
-compdef _git grv=git-remote
-compdef _git grmv=git-remote
-compdef _git grrm=git-remote
-compdef _git grset=git-remote
-compdef _git grset=git-remote
-compdef _git gb=git-branch
-compdef _git gba=git-branch
-compdef gcount=git
-compdef _git gcp=git-cherry-pick
-compdef _git glg=git-log
-compdef _git glgg=git-log
-compdef _git glgga=git-log
-compdef _git gss=git-status
-compdef _git ga=git-add
-compdef _git gm=git-merge
-compdef ggpull=git
-compdef ggpush=git
-compdef ggpnp=git
+if is434; then
+ # git related
+ compdef g=git
+ compdef _git gst=git-status
+ compdef _git gl=git-pull
+ compdef _git gup=git-fetch
+ compdef _git gp=git-push
+ gdv() { git diff -w "$@" }
+ compdef _git gdv=git-diff
+ compdef _git gc=git-commit
+ compdef _git gca=git-commit
+ compdef _git gco=git-checkout
+ compdef _git gr=git-remote
+ compdef _git grv=git-remote
+ compdef _git grmv=git-remote
+ compdef _git grrm=git-remote
+ compdef _git grset=git-remote
+ compdef _git grset=git-remote
+ compdef _git gb=git-branch
+ compdef _git gba=git-branch
+ compdef gcount=git
+ compdef _git gcp=git-cherry-pick
+ compdef _git glg=git-log
+ compdef _git glgg=git-log
+ compdef _git glgga=git-log
+ compdef _git gss=git-status
+ compdef _git ga=git-add
+ compdef _git gm=git-merge
+ compdef ggpull=git
+ compdef ggpush=git
+ compdef ggpnp=git
+fi
# bindkey '\e[2~' overwrite-mode # Insert
# ;;
*xterm*|rxvt)
- bindkey '\e[H' beginning-of-line # Home
+ bindkey '\e[H' beginning-of-line # Home
bindkey '\e[F' end-of-line # End
+ # I need the next two when in rxvt via ssh.
+ bindkey '\e[7~' beginning-of-line # home
+ bindkey '\e[8~' end-of-line # end
bindkey '\e[3~' delete-char # Del
bindkey '\e[2~' overwrite-mode # Insert
- bindkey "^[[5C" forward-word # ctrl cursor right
- bindkey "^[[5D" backward-word # ctrl cursor left
+ bindkey "^[[5C" forward-word # ctrl cursor right
+ bindkey "^[[5D" backward-word # ctrl cursor left
;;
esac
## This function allows you type a file pattern,
## and see the results of the expansion at each step.
## When you hit return, they will be inserted into the command line.
-autoload -U insert-files
-zle -N insert-files
-bindkey "^Xf" insert-files ## C-x-f
+if is4 && zrcautoload insert-files && zle -N insert-files; then
+ #k# Insert files and test globbing
+ bindkey "^Xf" insert-files ## C-x-f
+fi
## This set of functions implements a sort of magic history searching.
## After predict-on, typing characters causes the editor to look backward
## line doesn't match something in the history, adding a key performs
## standard completion - though editing in the middle is liable to delete
## the rest of the line.
-autoload -U predict-on
-zle -N predict-on
-#zle -N predict-off
-bindkey "^X^R" predict-on ## C-x C-r
-#bindkey "^U" predict-off ## C-u
+if is4 && zrcautoload predict-on && zle -N predict-on; then
+ #zle -N predict-off
+ bindkey "^X^R" predict-on ## C-x C-r
+ #bindkey "^U" predict-off ## C-u
+fi
# used when you press M-? on a command line
alias which-command='whence -a'
# this has the disadvantage that in 'bar|baz' it eats all of it.
typeset WORDCHARS='|'$WORDCHARS
-autoload -U edit-command-line
-zle -N edit-command-line
-bindkey '\C-x\C-e' edit-command-line
+# press ctrl-x ctrl-e for editing command line in $EDITOR or $VISUAL
+if is4 && zrcautoload edit-command-line && zle -N edit-command-line; then
+ bindkey '\C-x\C-e' edit-command-line
+fi
ZSHMODPREFIX="zsh/"
# For checking of message status.
-zmodload -i ${ZSHMODPREFIX}stat
+is4 && zmodload -i ${ZSHMODPREFIX}stat
# For checking job return status.
-zmodload -i ${ZSHMODPREFIX}parameter
+is4 && zmodload -i ${ZSHMODPREFIX}parameter
# Gives strftime and $EPOCHSECONDS
-zmodload -i ${ZSHMODPREFIX}datetime
+is4 && zmodload -i ${ZSHMODPREFIX}datetime
# Maybe use emacsclient?
(( $+commands[emacsclient] )) && {
export ALTERNATE_EDITOR=$EDITOR
- export EDITOR="emacsclient -t"
+ export EDITOR=$ZDOTDIR/run/eeditor-$HOST-$UID
+ cat <<EOF >| $EDITOR
+#!/bin/sh
+exec emacsclient -t "\$@"
+EOF
+ chmod +x $EDITOR
# Maybe with -n
- alias e="emacsclient"
+ alias e="emacsclient -t"
}
}
--- /dev/null
+# -*- mode: sh;-*-
+
+# Lets remove stuff that we only really needed during zsh setup.
+__ () {
+ emulate -L zsh
+ local -a funcs
+ # is439 is not here, as its used in precmd
+ # is434 is used in agent()
+ funcs=(zrcautoload is4 is41 is42 is425 is43 is433 isdarwin isfreebsd salias )
+
+ for func in $funcs ; do
+ [[ -n ${functions[$func]} ]] \
+ && unfunction $func
+ done
+ return 0
+} && __
+unfunction __
+
--- /dev/null
+# -*- mode:sh -*-
+
+# From: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
+local T='gYw' # The test text
+
+local fg
+local bg
+printf "\n%12s" ""
+for fg in {40..47}; do
+ printf "%7sm" ${fg}
+done
+printf "\n"
+for fg in 0 1 $(for i in {30..37}; do echo $i 1\;$i; done); do
+ printf " %5s \e[%s %s " ${fg}m ${fg}m ${T}
+ for bg in {40..47}m; do
+ printf " \e[%s\e[%s %s \e[0m" ${fg}m ${bg} ${T}
+ done
+ printf "\n"
+done
+printf "\n"
# -*- mode:sh -*-
# update VCS information
-vcs_info
+is439 && vcs_info
# set variable debian_chroot if running in a chroot with /etc/debian_chroot
if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]] ; then
# -*- mode:sh -*-
if [[ "$TERM" == "screen" ]]; then
- local CMD=${1[(wr)^(*=*|sudo|ssh|sshc|-*)]}
+ local CMD=${2[(wr)^(*=*|command|noclobber|sudo|ssh|sshc|-*)]}
echo -n "\ek$CMD\e\\"
fi
--- /dev/null
+# -*- mode:sh -*-
+
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+ reset "%{\e[00m%}"
+ bold "%{\e[01m%}" no-bold "%{\e[22m%}"
+ italic "%{\e[03m%}" no-italic "%{\e[23m%}"
+ underline "%{\e[04m%}" no-underline "%{\e[24m%}"
+ blink "%{\e[05m%}" no-blink "%{\e[25m%}"
+ reverse "%{\e[07m%}" no-reverse "%{\e[27m%}"
+)
+
+for color in {000..255}; do
+ FG[$color]="%{\e[38;5;${color}m%}"
+ BG[$color]="%{\e[48;5;${color}m%}"
+done
+
+# Show all 256 colors with color number
+for code in {000..255}; do
+ print -P -- "$code: %F{$code}Test%f"
+done
+
--- /dev/null
+# -*- mode:sh -*-
+
+_jj_ssh() {
+ # TERM is one of the variables that is usually allowed to be
+ # transmitted to the remote session. The remote host should have the
+ # appropriate termcap or terminfo file to handle the TERM you
+ # provided. When connecting to random hosts, this may not be the
+ # case if your TERM is somewhat special. A good fallback is
+ # xterm. Most terminals are compatible with xterm and all hosts have
+ # a termcap or terminfo file to handle xterm. Therefore, for some
+ # values of TERM, we fallback to xterm.
+ #
+ # Now, you may connect to a host where your current TERM is fully
+ # supported and you will get xterm instead (which means 8 base
+ # colors only). There is no clean solution for this. You may want to
+ # reexport the appropriate TERM when logged on the remote host or
+ # use commands like this: ssh -t XXXXX env TERM=$TERM emacsclient -t
+ # -c
+ #
+ # If the remote host uses the same zshrc than this one, there is
+ # something in `$ZSH/rc/00-terminfo.zsh` to restore the appropriate
+ # terminal (saved in `LC__ORIGINALTERM`).
+ #
+ # The problem is quite similar for LANG and LC_MESSAGES. We reset
+ # them to C to avoid any problem with hosts not having your locally
+ # installed locales. See this post for more details on this:
+ # http://vincent.bernat.im/en/blog/2011-zsh-zshrc.html
+ #
+ # Also, when the same ZSH configuration is used on the remote host,
+ # the locale is reset with the help of 12-Locale.zsh
+ case "$TERM" in
+ rxvt-256color|rxvt-unicode*)
+ LC__ORIGINALTERM=$TERM TERM=xterm LANG=C LC_MESSAGES=C command ssh "$@"
+ ;;
+ *)
+ LANG=C LC_MESSAGES=C command ssh "$@"
+ ;;
+ esac
+}
+
+_jj_first_non_optional_arg() {
+ local args
+ args=( "$@" )
+ args=( ${(R)args:#-*} )
+ print -- $args[1]
+}
+
+# Alter window title
+_jj_title () {
+ [ -t 1 ] || return
+ emulate -L zsh
+ local title
+ title=${@//[^[:alnum:]\/>< ._~:=?@-]/ }
+ case $TERM in
+ screen*)
+ print -n "\ek$title\e\\"
+ print -n "\e]1;$title\a"
+ print -n "\e]2;$title\a"
+ ;;
+ rxvt*|xterm*)
+ print -n "\e]1;$title\a"
+ print -n "\e]2;$title\a"
+ ;;
+ esac
+}
+
+_jj_title $(_jj_first_non_optional_arg "$@")
+_jj_ssh "$@"
--- /dev/null
+# -*- mode:sh -*-
+
+case "${TERM}" in
+ rxvt*)
+ LC_ORIGINALTERM=$TERM TERM=xterm command sudo "$@"
+ ;;
+ *)
+ command sudo "$@"
+ ;;
+esac
--- /dev/null
+# -*- mode:sh -*-
+
+history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
work=$(mktemp -d)
start=$(pwd)
{
- local OK="$fg_bold[green]OK.${reset_color}"
- print -n "$fg[green]Building archive...${reset_color} "
- #cd $ZSH
- vcsh run zsh git archive HEAD | tar -C $work -xf -
+ local OK="$fg_bold[green]OK.${reset_color}"
+ print -n "$fg[green]Building archive...${reset_color} "
+ cd $ZSH
+ git archive HEAD | tar -C $work -xf -
mkdir -p $work/zsh-syntax-highlighting
cd $ZSH/zsh-syntax-highlighting
git archive HEAD | tar -C $work/zsh-syntax-highlighting -xf -
- cp $HOME/.zshenv $work/zshenv.home
+ cp $HOME/.zshenv $work/zshenv.home
print $OK
- print -n "$fg[green]Building installer...${reset_color} "
- makeself --gzip $work $ZSH/zsh-install.sh \
- "$USER ZSH config files" zsh ./install.zsh MAGIC
- print $OK
- [[ -z $1 ]] || {
- print "$fg[green]Remote install...${reset_color} "
- scp $ZSH/zsh-install.sh ${remote}:
- ssh $remote sh ./zsh-install.sh
- print $OK
- }
+ print -n "$fg[green]Building installer...${reset_color} "
+ makeself --gzip $work $ZSH/zsh-install.sh \
+ "$USER ZSH config files" zsh ./install.zsh MAGIC
+ print $OK
+ [[ -z $1 ]] || {
+ print "$fg[green]Remote install...${reset_color} "
+ scp $ZSH/zsh-install.sh ${remote}:
+ ssh $remote sh ./zsh-install.sh
+ print $OK
+ }
} always {
- rm -rf $work
+ rm -rf $work
cd $start
}
}
# We can be executed to install ourself to the final destination
if [[ $1 == "MAGIC" ]]; then
(( $+commands[rsync] )) || {
- print "$fg_bold[red]rsync not found, install it${reset_color}"
- exit 2
+ print "$fg_bold[red]rsync not found, install it${reset_color}"
+ exit 2
}
local OK="$fg[green]OK.${reset_color}"
# Migrate history
print -n "$fg[green]History migration...${reset_color} "
mkdir -p ~/.zsh/var/dirhist
+ if [[ -f ~/.zsh_history ]] && [[ ! -f ~/.zsh/var/history.$USER.$HOST ]]; then
+ { mv ~/.zsh_history ~/.zsh/var/history.$USER.$HOST }
+ fi
+ print $OK
+ print -n "$fg[green]HMoving completion dump...${reset_color} "
mkdir -p ~/.zsh/.zcompcache
- { mv ~/.zsh_history ~/.zsh/var/history.$USER.$HOST } 2> /dev/null
+ for file in ~/.zcompdump ~/.zsh/.zcompdump; do
+ if [[ -f $file ]]; then
+ mv $file ~/.zsh/var/.zcompdump
+ fi
+ done
print $OK
print "$fg[green]Installation of zsh files...${reset_color} "
rsync -rlp --exclude=var/ --exclude=.zcompcache/ --delete . ~/.zsh/.
--- /dev/null
+# -*- mode: sh;-*-
+
+if which ssh-agent >/dev/null; then
+ agent() {
+ eval $(ssh-agent) >/dev/null
+ ssh-add ~/.ssh/id_cole
+ }
+
+
+ _kill_agent() {
+ ssh-agent -k
+ }
+ is434 && add-zsh-hook zshexit _kill_agent
+fi
alias pdbal='LANG=C LC_ALL=C pdebuild --auto-debsign --debsign-k B12525C4 -- --pkgname-logfile --basetgz /var/cache/pbuilder/base_lenny_amd64.tgz --debbuildopts -sa '
alias vcr="vcsh run"
+alias vc="vcsh"
# -*- mode: sh;-*-
-# In addition to what we have globally
-_hostdescs_debconf=(${${${${(f)"$(<$HOME/.hostdesc.debconf)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_ganneff=(${${${${(f)"$(<$HOME/.hostdesc.ganneff)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_ilo=(${${${${(f)"$(<$HOME/.hostdesc.ilo)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_nsb=(${${${${(f)"$(<$HOME/.hostdesc.nsb)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_oftc=(${${${${(f)"$(<$HOME/.hostdesc.oftc)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_other=(${${${${(f)"$(<$HOME/.hostdesc.other)"}:#[\|]*}%%\ *}%%,*})
-_hostdescs_spi=(${${${${(f)"$(<$HOME/.hostdesc.spi)"}:#[\|]*}%%\ *}%%,*})
+if is42; then
+ # In addition to what we have globally
+ _hostdescs_debconf=(${${${${(f)"$(<$HOME/.hostdesc.debconf)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_ganneff=(${${${${(f)"$(<$HOME/.hostdesc.ganneff)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_ilo=(${${${${(f)"$(<$HOME/.hostdesc.ilo)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_nsb=(${${${${(f)"$(<$HOME/.hostdesc.nsb)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_oftc=(${${${${(f)"$(<$HOME/.hostdesc.oftc)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_other=(${${${${(f)"$(<$HOME/.hostdesc.other)"}:#[\|]*}%%\ *}%%,*})
+ _hostdescs_spi=(${${${${(f)"$(<$HOME/.hostdesc.spi)"}:#[\|]*}%%\ *}%%,*})
+else
+ _hostdescs_debconf=()
+ _hostdescs_ganneff=()
+ _hostdescs_ilo=()
+ _hostdescs_nsb=()
+ _hostdescs_oftc=()
+ _hostdescs_other=()
+ _hostdescs_spi=()
+fi
hosts=(
${HOST}
# -*- mode: sh;-*-
source $ZDOTDIR/install.zsh
+
+if which ssh-agent >/dev/null; then
+ agent() {
+ eval $(ssh-agent) >/dev/null
+ ssh-add ~/.ssh/privat
+ ssh-add ~/.ssh/debian
+ is434 && add-zsh-hook zshexit _kill_agent
+ }
+
+
+ _kill_agent() {
+ ssh-agent -k
+ }
+fi
#-----------------------------------------------------------------------------
setopt extendedglob
-zmodload -F zsh/parameter
-
+if [[ $ZSH_VERSION == 4.3.<4->* || $ZSH_VERSION == 4.<4->* \
+ || $ZSH_VERSION == <5->* ]]; then
+ zmodload -F zsh/parameter
+else
+ zmodload zsh/parameter 2>/dev/null
+fi
#
# We have to "override" some keys and widgets if the
# zsh-syntax-highlighting plugin has not been loaded:
#-------------------------------------------------------------------------------
# configuration, the base under which the directory histories are stored
#-------------------------------------------------------------------------------
+if ! [[ $ZSH_VERSION == 4.3.<4->* || $ZSH_VERSION == 4.<4->* \
+ || $ZSH_VERSION == <5->* ]]; then
+ return
+fi
[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
--- /dev/null
+# From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
+# Updated: Özgür Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
+# Updated: Marc Lehmann <pcg@goof.com>, 17 Feb 2005
+# Updated: Marc Lehmann <schmorp@schmorp.de>, 04 Nov 2008: change init/reset sequences
+rxvt-unicode|rxvt-unicode terminal (X Window System),
+ am,
+ bce,
+ eo,
+ km,
+ msgr,
+ xenl,
+ hs,
+ cols#80,
+ it#8,
+ lines#24,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~-A.B+C\,D0EhFiG,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub=\E[%p1%dD,
+ cub1=^H,
+ cud=\E[%p1%dB,
+ cud1=^J,
+ cuf=\E[%p1%dC,
+ cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu=\E[%p1%dA,
+ cuu1=\E[A,
+ cvvis=\E[?25h,
+ dch=\E[%p1%dP,
+ dch1=\E[P,
+ dl=\E[%p1%dM,
+ dl1=\E[M,
+ ed=\E[J,
+ el=\E[K,
+ el1=\E[1K,
+ flash=\E[?5h$<20/>\E[?5l,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ ht=^I,
+ hts=\EH,
+ ich=\E[%p1%d@,
+ ich1=\E[@,
+ il=\E[%p1%dL,
+ il1=\E[L,
+ ind=^J,
+ is1=\E[\041p,
+ is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ kDC=\E[3$,
+ kIC=\E[2$,
+ kEND=\E[8$,
+ kHOM=\E[7$,
+ kLFT=\E[d,
+ kNXT=\E[6$,
+ kPRV=\E[5$,
+ kRIT=\E[c,
+ kbs=\177,
+ ka1=\EOw,
+ ka3=\EOy,
+ kb2=\EOu,
+ kc1=\EOq,
+ kc3=\EOs,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kel=\E[8\^,
+ kend=\E[8~,
+ kent=\EOM,
+ kf1=\E[11~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf2=\E[12~,
+ kf20=\E[34~,
+ kf3=\E[13~,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kfnd=\E[1~,
+ khome=\E[7~,
+ kich1=\E[2~,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kslt=\E[4~,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs1=\Ec,
+ rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ sgr0=\E[m\E(B,
+ enacs=,
+ smacs=\E(0,
+ rmacs=\E(B,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ vpa=\E[%i%p1%dd,
+ colors#88,
+ pairs#7744,
+ btns#5,
+ lm#0,
+ ccc,
+ npc,
+ mc5i,
+ ncv#0,
+ mir,
+ xon,
+ bw,
+ ech=\E[%p1%dX,
+ mc0=\E[i,
+ mc4=\E[4i,
+ mc5=\E[5i,
+ sitm=\E[3m,
+ ritm=\E[23m,
+ smam=\E[?7h,
+ rmam=\E[?7l,
+ smir=\E[4h,
+ rmir=\E[4l,
+ smcup=\E[?1049h,
+ rmcup=\E[r\E[?1049l,
+ smkx=\E=,
+ rmkx=\E>,
+ indn=\E[%p1%dS,
+ rin=\E[%p1%dT,
+ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
+ op=\E[39;49m,
+ setaf=\E[38;5;%p1%dm,
+ setab=\E[48;5;%p1%dm,
+ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
+ sc=\E7,
+ s0ds=\E(B,
+ s1ds=\E(0,
+ s2ds=\E*B,
+ s3ds=\E+B,
+ u6=\E[%i%d;%dR,
+ u7=\E[6n,
+ u8=\E[?1;2c,
+ u9=\E[c,
+ tsl=\E]2;,
+ fsl=\007,
+ dsl=\E]2;\007,
+
+rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System),
+ colors#256,
+ pairs#32767,
+ use=rxvt-unicode,
+
+rxvt-256color|rxvt-unicode terminal with 256 colors (X Window System),
+ use=rxvt-unicode-256color,
export PATH USER HOST DOMAIN UID
-# Now that FPATH is set correctly, do autoloaded functions.
-# autoload all functions in $FPATH - that is, all files in
-# each component of the array $fpath. If there are none, feed the list
-# it prints into /dev/null.
-for paths in "$fpath[@]"; do
- autoload -U "$paths"/*(N:t) >/dev/null
-done
-unset paths
-
# Command to use when redirecting from/to a null command.
# READNULLCMD is redefined in .zshrc for interactive shells.
READNULLCMD=cat
--- /dev/null
+############
+#
+# .zshenv
+# Written by Joerg Jaspert <joerg@debian.org>
+#
+############
+ZDOTDIR=${ZDOTDIR:-"${HOME}/.zsh"}
+[ -r "${ZDOTDIR}/zshenv" ] && . "${ZDOTDIR}/zshenv"
+
+# Don't do anything more in here, do everything inside
+# $ZDOTDIR!