Skip to content

Instantly share code, notes, and snippets.

@lentil
Created July 26, 2010 20:40

Revisions

  1. @kevinmcconnell kevinmcconnell created this gist Jul 26, 2010.
    62 changes: 62 additions & 0 deletions my .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    # paths
    export PATH="/usr/local/bin:/usr/local/pgsql/bin:/usr/local/git/bin/:/usr/local/redis:$PATH"
    export MANPATH=/usr/local/man:/usr/local/pgsql/man:/usr/local/git/share/man:$MANPATH

    # history
    HISTFILE=$HOME/.zhistory
    HISTSIZE=100000
    SAVEHIST=100000
    setopt INC_APPEND_HISTORY
    setopt HIST_IGNORE_DUPS
    setopt HIST_IGNORE_SPACE
    setopt EXTENDED_HISTORY
    setopt AUTOPUSHD

    # up/down arrow history matching
    bindkey "^[[A" history-search-backward
    bindkey "^[[B" history-search-forward

    # programs
    PAGER='less'
    EDITOR='vim'

    # enable colored LS
    export CLICOLOR=true
    export LSCOLORS=Bxfxcxdxbxegedabagacad

    # completion options
    autoload -Uz compinit
    compinit
    zstyle ':completion:*:descriptions' format "[%d]"
    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
    zstyle ':completion:*' list-colors ''

    # hacky git prompt

    function __git_flags {
    st=`git status -s`
    local flags=''
    `echo "$st" | grep -q '^[MAD]'` && flags="${flags}➚"
    `echo "$st" | grep -q '^.[MAD]'` && flags="${flags}⚡"
    `echo "$st" | grep -q '^?'` && flags="${flags}⊕"
    echo $flags
    }

    function git_status {
    local branch=`git symbolic-ref HEAD 2>/dev/null`
    branch="${branch#refs/heads/}"
    if [ $branch ]; then
    echo " (${branch}$(__git_flags))"
    fi
    }

    setopt prompt_subst
    PROMPT='%c$(git_status) $ '

    # override settings for specific hosts
    HOST_SPECIFIC_FILENAME=$HOME/.conf/zsh/`hostname -s`.zshrc
    test -e $HOST_SPECIFIC_FILENAME && source $HOST_SPECIFIC_FILENAME