Skip to content

Instantly share code, notes, and snippets.

View towerhe's full-sized avatar

Tower He towerhe

View GitHub Profile
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"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
set guifont=Menlo\ Regular:h14
color molokai
au BufNewFile,BufRead *.emblem set filetype=slim
let mapleader = ","
" Folding
set foldenable
set foldmethod=indent
--type-add
ruby=.haml,.ru,.emblem
--type-add
css=.scss,.sass,.less
--type-add
js=.coffee,.hbs
unbind C-b
set -g prefix C-a
setw -g mode-keys vi
# split window like vim
# vim's defination of a horizontal/vertical split is revised from tumx's
bind s split-window -h
bind v split-window -v
# move arount panes wiht hjkl, as one would in vim after C-w
bind h select-pane -L
@towerhe
towerhe / install_chef.sh
Created October 18, 2012 03:28
Scripts for installing chef
# Reset the source list of apt-get
echo 'deb http://mirrors.163.com/ubuntu precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu precise-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu precise-updates main restricted universe multiverse' | sudo tee /etc/apt/sources.list
sudo apt-get update
# Install Ruby and Rubygems
sudo apt-get -y install ruby rubygems
@towerhe
towerhe / vim-folding
Created March 20, 2012 13:21
Enable folding in vim
" Folding
set foldenable
set foldmethod=indent
set foldlevel=99999
" Folding expand/collapse mappings
map + zo
map - zc
map ++ zR
map -- zM
@towerhe
towerhe / towerhe.zsh-theme
Created January 29, 2012 06:29
My oh-my-zsh theme
# Get the current ruby version in use with RVM:
if [ -e ~/.rvm/bin/rvm-prompt ]; then
RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} "
else
if which rbenv &> /dev/null; then
RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} "
fi
fi
setopt PROMPT_SUBST