106 lines
2.9 KiB
Bash
106 lines
2.9 KiB
Bash
#complist
|
|
# If not running interactively, don't do anything
|
|
[ -z "$PS1" ] && return
|
|
|
|
# don't put duplicate lines in the history. See bash(1) for more options
|
|
export HISTCONTROL=ignoredups
|
|
|
|
# make less more friendly for non-text input files, see lesspipe(1)
|
|
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
|
|
|
# set variable identifying the chroot you work in (used in the prompt below)
|
|
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
|
debian_chroot=$(cat /etc/debian_chroot)
|
|
fi
|
|
|
|
|
|
PERL5LIB=$HOME/local/lib64/perl5/site_perl/5.8.8/
|
|
autoload -U compinit
|
|
compinit
|
|
setopt extended_glob
|
|
bindkey -e
|
|
#ZLS_COLORS=$LS_COLORS
|
|
|
|
|
|
export DISTCC_HOSTS='hyades01 hyades02 hyades03 hyades04'
|
|
if [[ "$GOROOT" == "" ]]; then
|
|
export GOROOT=$HOME/local/go
|
|
export GOARCH=amd64
|
|
export GOOS=linux
|
|
case `uname` in
|
|
Darwin)
|
|
export GOOS=darwin
|
|
;;
|
|
FreeBSD)
|
|
export GOOS=freebsd
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
|
|
setopt prompt_subst
|
|
|
|
|
|
###
|
|
# See if we can use colors.
|
|
|
|
autoload colors zsh/terminfo
|
|
if [[ "$terminfo[colors]" -ge 8 ]]; then
|
|
colors
|
|
fi
|
|
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
|
|
eval PR_LIGHT_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
|
|
eval PR_$color='%{$fg[${(L)color}]%}'
|
|
(( count = $count + 1 ))
|
|
done
|
|
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
|
|
|
|
###
|
|
# Decide whether to set a screen title
|
|
# if [[ "$TERM" == "screen" ]]; then
|
|
# PR_STITLE=$'%{\ekzsh\e\\%}'
|
|
# else
|
|
# PR_STITLE=''
|
|
# fi
|
|
|
|
# preexec () {
|
|
# local CMD="${1/#sudo /#}"
|
|
# local CMD="${CMD/#nano /}"
|
|
# local CMD="${CMD/#ssh />}"
|
|
# $SCREENME true || echo -ne "\ek${CMD%% *}\e\\"
|
|
# }
|
|
#precmd () {
|
|
#$SCREENME true || echo -ne "\ekzsh\e\\"
|
|
#}
|
|
|
|
PROMPT='$PR_STITLE$PR_LIGHT_BLUE($PR_LIGHT_YELLOW%D{%H:%M}|%!$PR_BLUE%)[%(!.$PR_RED.$PR_GREEN)%n@%m$PR_LIGHT_CYAN %~$PR_BLUE]$PR_NO_COLOUR%(!.#.$) '
|
|
#source .zshprompt
|
|
|
|
#source ~/.zsh_profile
|
|
source ~/.zprofile
|
|
if [ -f ~/.bash_aliases ]; then
|
|
source ~/.bash_aliases
|
|
fi
|
|
source ~/.zshenv
|
|
|
|
##############################################################
|
|
## Stuff from http://zshwiki.org/home/examples/compquickstart #
|
|
###############################################################
|
|
zmodload zsh/complist
|
|
autoload -U compinit && compinit
|
|
zstyle ':completion:::::' completer _complete _approximate
|
|
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
|
|
zstyle ':completion:*:descriptions' format "- %d -"
|
|
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
|
|
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
|
|
zstyle ':completion:*' group-name ''
|
|
zstyle ':completion:*:manuals' separate-sections true
|
|
zstyle ':completion:*' menu select
|
|
zstyle ':completion:*' verbose yes
|
|
## case-insensitive (uppercase from lowercase) completion
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
|
#zstyle ':completion:*' special-dirs ..
|
|
|
|
if [ -n "`which fortune`" ]; then
|
|
fortune
|
|
fi
|