Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

$HOME/.zsh/

  • Loading branch information...
commit d5ba3f2cb3fa6fac0481755be0c66fc396e776ca 0 parents
@Oshuma authored
7 README
@@ -0,0 +1,7 @@
+$HOME/.zsh/
+-----------
+
+git clone git://github.com/Oshuma/zsh-dir.git ~/.zsh
+ln -s ~/.zsh/zshrc ~/.zshrc
+
+Overrides or OS specific settings can go in custom/*.zsh as it's loaded after lib/*.zsh
0  custom/.gitignore
No changes.
1  custom/os_specific.zsh
@@ -0,0 +1 @@
+# OS Specific Configuration
27 lib/git.zsh
@@ -0,0 +1,27 @@
+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}(%{$fg[yellow]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}xxx%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})---"
+
+# get the name of the branch we are on
+function git_prompt_info() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+parse_git_dirty () {
+ if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
+ echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+ else
+ echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+ fi
+}
+
+#
+# Will return the current branch name
+# Usage example: git pull origin $(current_branch)
+#
+function current_branch() {
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ echo ${ref#refs/heads/}
+}
4 lib/theme.zsh
@@ -0,0 +1,4 @@
+PROMPT=$'\n%B%{$fg[blue]%}<[%b%{$fg[yellow]%}%D{%a %b %d, %I:%M:%S}%B%{$fg[blue]%}]%b
+%B%{$fg[blue]%} [%{$fg[green]%}%n%b%{$fg[white]%}@%B%{$fg[cyan]%}%m%{$fg[blue]%}]%b%{$reset_color%} - %B%{$fg[blue]%}[%b%{$reset_color%}%~%B%{$fg[blue]%}]%b
+%B%{$fg[blue]%}<[%{$fg[red]%}%#%{$fg[blue]%}]%B%{$fg[blue]%}$(git_prompt_info)%B%{$fg[blue]%}>%b %{$reset_color%}'
+PS2=$' %B%{$fg[blue]%}->%b%{$reset_color%} '
122 zshrc
@@ -0,0 +1,122 @@
+# ----------------------
+# zsh config
+# ----------------------
+
+# TODO: Split this beast into ~/.zsh/lib/*.zsh
+
+# History
+HISTFILE=~/.zsh_history
+HISTSIZE=1000
+SAVEHIST=1000
+setopt hist_ignore_dups
+setopt hist_verify
+setopt extended_history
+setopt hist_expire_dups_first
+
+# Bindings
+bindkey -e
+bindkey "^A" beginning-of-line
+bindkey "^E" end-of-line
+
+# Completion
+autoload -Uz compinit
+compinit
+
+if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
+ zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+ unset CASE_SENSITIVE
+else
+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+fi
+
+zstyle ':completion:*' list-colors ''
+
+# Misc.
+autoload colors; colors;
+setopt prompt_subst
+setopt autocd
+unsetopt beep
+
+# smart URL quoting
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+
+# ----------------------
+# variables
+# ----------------------
+# export PATH=$PATH:/sbin:/usr/sbin
+export PATH=$PATH:"/home/oshuma/Source/Java/BlackBerry/WTK2.5.2/bin"
+export EDITOR=/usr/bin/vim
+export GREP_OPTIONS='--color=auto'
+export LC_ALL=C
+export PAGER=less
+export LESS='-M -R -X'
+export IRB_HISTORY_FILE=$HOME/.irb_history
+
+
+# ----------------------
+# aliases
+# ----------------------
+alias cp='cp -i'
+alias mv='mv -i'
+alias rm='rm -i'
+
+alias ..='cd ..'
+alias ...='cd ../..'
+alias ....='cd ../../..'
+
+alias _='sudo'
+alias dirs='dirs -v'
+alias ls='ls --color -F'
+alias l='ls -l'
+alias la='ls -a'
+alias lh='ls -lh'
+alias rails='nocorrect rails'
+alias scr='screen -A -m -S'
+
+# git
+alias git='nocorrect git' # no zsh correction for 'git'
+alias ga='git add'
+alias gb='git branch -a -v'
+alias gd='git diff'
+alias gi='git status; echo; git branch -av'
+alias gm='git merge '
+alias gnb='git checkout -b ' # must pass new branch name
+# alias gx='gitx'
+
+# ruby
+alias ra='rake'
+alias rt='rake --tasks'
+alias gemi='gem install --no-ri --no-rdoc '
+alias sgemi='sudo gem install --no-ri --no-rdoc '
+alias bundle='nocorrect bundle'
+
+# misc
+alias pfind='ps aux |grep '
+alias getip="curl -s http://checkip.dyndns.org | sed 's/[^0-9.]//g'"
+
+
+# ----------------------
+# functions
+# ----------------------
+
+# gc => git checkout master
+# gc bugs => git checkout bugs
+function gc {
+ if [ -z "$1" ]; then
+ git checkout master
+ else
+ git checkout $1
+ fi
+}
+
+# function trash {
+# mv -i $* $HOME/.Trash/
+# }
+
+
+# Load any .zsh config files in $HOME/.zsh/lib/
+export ZSH_HOME=$HOME/.zsh
+for config_file ($ZSH_HOME/lib/*.zsh) source $config_file
+for custom_file ($ZSH_HOME/custom/*.zsh) source $custom_file
Please sign in to comment.
Something went wrong with that request. Please try again.