Skip to content

Instantly share code, notes, and snippets.

@ghawkgu
Created October 10, 2016 16:23
Show Gist options
  • Save ghawkgu/baceb187ea9592385723f370937b3297 to your computer and use it in GitHub Desktop.
Save ghawkgu/baceb187ea9592385723f370937b3297 to your computer and use it in GitHub Desktop.
zsh settings
# ~/.oh-my-zsh/custom/tjkirch-with-ruby.zsh-theme
function _update_ruby_version()
{
typeset -g ruby_version=''
if which rvm-prompt &> /dev/null; then
ruby_version="$(rvm-prompt i v g)"
rvm-prompt i v g
else
if which rbenv &> /dev/null; then
ruby_version="Ruby: $(rbenv version | sed -e "s/ (set.*$//")"
fi
fi
}
_update_ruby_version
chpwd_functions+=(_update_ruby_version)
function _update_python_version()
{
typeset -g python_version=''
if which rbenv &> /dev/null; then
python_version="Python: $(pyenv version | sed -e "s/ (set.*$//")"
fi
}
_update_python_version
chpwd_functions+=(_update_python_version)
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡"
ZSH_THEME_GIT_PROMPT_CLEAN=""
function prompt_char {
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
}
PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%}
)
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %{$fg_bold[red]%} (${ruby_version} ${python_version})%{$reset_color%}
%_$(prompt_char) '
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
# 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="robbyrussell"
ZSH_THEME="tjkirch-with-ruby"
# 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="false"
# 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"
export VIRTUAL_ENV_DISABLE_PROMPT=1
# export PYENV_VIRTUALENV_DISABLE_PROMPT=1
# 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 osx rbenv pyenv nvm npm)
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
#alias ls='ls -FhlG'
alias ls='ls -G'
alias ll='ls -Fhl'
alias lla="ll -a"
alias rbenv_install="RUBY_CONFIGURE_OPTS=\"--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`\" rbenv install -f"
fpath=(/usr/local/share/zsh-completions $fpath)
. $HOME/.profile
. $HOME/.user.d/z-alias
alias brew="env PATH=${PATH//$(pyenv root)\/shims:/} brew"
# Completion
## Complete the process's id or name for kill or killall
zstyle ':completion:*:processes-names' command 'ps -e -o comm='
zstyle ':completion:*:processes' command 'ps -au$USER'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
# Fix the ctrl-s issue http://code.google.com/p/iterm2/issues/detail?id=1304
if [ -t 0 ]; then
# stty ixany
# stty ixoff -ixon
# stty stop undef
# stty start undef
stty -ixon -ixoff
fi
# plugins+=(zsh-completions)
# autoload -U compinit && compinit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment