Created
October 29, 2013 15:00
-
-
Save xiocode/7216296 to your computer and use it in GitHub Desktop.
zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="ys" | |
# Example aliases | |
# alias zshconfig="mate ~/.zshrc" | |
# alias ohmyzsh="mate ~/.oh-my-zsh" | |
# Set to this to use case-sensitive completion | |
# CASE_SENSITIVE="true" | |
# Comment this out to disable bi-weekly auto-update checks | |
# DISABLE_AUTO_UPDATE="true" | |
# Uncomment to change how often before auto-updates occur? (in days) | |
# export UPDATE_ZSH_DAYS=13 | |
# Uncomment following line if you want to disable colors in ls | |
# DISABLE_LS_COLORS="true" | |
# Uncomment following line if you want to disable autosetting terminal title. | |
# DISABLE_AUTO_TITLE="true" | |
# Uncomment following line if you want to disable command autocorrection | |
# DISABLE_CORRECTION="true" | |
# Uncomment following line if you want red dots to be displayed while waiting for completion | |
# COMPLETION_WAITING_DOTS="true" | |
# Uncomment following line if you want to disable marking untracked files under | |
# VCS as dirty. This makes repository status check for large repositories much, | |
# much faster. | |
# DISABLE_UNTRACKED_FILES_DIRTY="true" | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ | |
# Example format: plugins=(rails git textmate ruby lighthouse) | |
plugins=(git) | |
source $ZSH/oh-my-zsh.sh | |
# Customize to your needs... | |
export HISTSIZE=10000 | |
export SAVEHIST=10000 | |
export HISTFILE=~/.zhistory | |
setopt INC_APPEND_HISTORY | |
setopt HIST_IGNORE_DUPS | |
setopt EXTENDED_HISTORY | |
setopt AUTO_PUSHD | |
setopt PUSHD_IGNORE_DUPS | |
cd() { | |
builtin cd "$@" # do actual cd | |
fc -W # write current history file | |
local HISTDIR="$HOME/.zsh_history$PWD" # use nested folders for history | |
if [ ! -d "$HISTDIR" ] ; then # create folder if needed | |
mkdir -p "$HISTDIR" | |
fi | |
export HISTFILE="$HISTDIR/zhistory" # set new history file | |
touch $HISTFILE | |
local ohistsize=$HISTSIZE | |
HISTSIZE=0 # Discard previous dir's history | |
HISTSIZE=$ohistsize # Prepare for new dir's history | |
fc -R #read from current histfile | |
} | |
mkdir -p $HOME/.zsh_history$PWD | |
export HISTFILE="$HOME/.zsh_history$PWD/zhistory" | |
function allhistory { cat $(find $HOME/.zsh_history -name zhistory) } | |
function convhistory { | |
sort $1 | uniq | | |
sed 's/^:\([ 0-9]*\):[0-9]*;\(.*\)/\1::::::\2/' | | |
awk -F"::::::" '{ $1=strftime("%Y-%m-%d %T",$1) "|"; print }' | |
} | |
function histall { convhistory =(allhistory) | | |
sed '/^.\{20\} *cd/i\\' } | |
function hist { convhistory $HISTFILE } | |
function top50 { allhistory | awk -F':[ 0-9]*:[0-9]*;' '{ $1="" ; print }' | sed 's/ /\n/g' | sed '/^$/d' | sort | uniq -c | sort -nr | head -n 50 } | |
########################################################################## | |
#alias ctags=/usr/local/bin/ctags | |
#alias gdb=/usr/local/bin/gdb | |
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH | |
export GOROOT=/Users/xio/developer/go | |
export GOPATH=/Volumes/Data/Dropbox/xio/darwin/go | |
export PATH=$GOROOT/bin:$GOPATH/bin:/usr/local/sbin:/usr/local/bin:$PATH | |
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh | |
autoload -U compinit && compinit | |
fpath=($HOME/.zsh/func $fpath) | |
typeset -U fpath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment