Source

shared / .zshrc

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=5000
SAVEHIST=5000
setopt incAppendHistory extendedGlob histIgnoreDups histExpireDupsFirst noClobber histReduceBlanks nullGlob
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/tdavies/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

#make home and end behave
bindkey '[1~' vi-beginning-of-line
bindkey '[4~' vi-end-of-line


fpath=(~/fbin/ $fpath)
path=(~/bin $path)

autoload -U colors ~/fbin/*[^~#](:t)

#alias visit='noglob visit'
alias ll='ls -lh --color=auto '
alias la='ll -A'
alias can-has='sudo aptitude install '

unalias run-help 2>/dev/null
autoload -U run-help

### initialize for terminals - must be last so tramp doesn't die
dumb_init(){
    PS1='%# '
    # for tramp to not hang, need the following. cf:
    # http://www.emacswiki.org/emacs/TrampMode
    unsetopt zle
    unsetopt prompt_cr
    unsetopt prompt_subst
    unfunction precmd
    unfunction preexec
}

xterm_init(){
    local LEN r h b g u LINE
    local COLUMNS=80
    colors
    LEN=$((COLUMNS - 2 - $( print -P "%n@%M" | wc -c)))
    r="%{$reset_color%}"
    h="%{$fg_bold[$host_colour]%}"
    b="%{$fg_bold[white]%}"
    g="%{$fg_bold[green]%}"
    if [[ $EUID == 0 ]]; then
	u="%{$fg_bold[red]%}";
    else
	u="%{$fg_bold[cyan]%}";
    fi
    LINE=$(echo -e $(echo ${(l:$COLUMNS::-:)} | sed 's/-/\\xe2\\x94\\x80/g'))
    PROMPT="%$LEN>>($g%~$r)$h$LINE%<< $r($u %n$g@$h%M $r)
$u%h %#$r > "
    echo
    echo "$fg_bold[$host_colour]${LINE}$reset_color" 
    env LINES=18 top -bn1
}
eterm-color_init(){
    xterm_init
}
rxvt_init(){
    xterm_init
}

case "${${TERM-dumb}:l}" in
    *rxvt*|*xterm*|eterm-color)
        #TERM=xterm #fixes broken backspace w/ rxvt
        xterm_init
        ;;
    *) dumb_init
        ;;
esac
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.