-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathzshrc
125 lines (103 loc) · 2.99 KB
/
zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Disable this oh-my-zsh feature since it messes with tmux window names.
DISABLE_AUTO_TITLE=true
export LANG="en_US.UTF-8"
# 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="philipe"
export EDITOR=vim
# Enable vi mode
bindkey -v
# Aliases
alias ls="ls -l"
alias -s md="open -a Marked"
function git(){hub "$@"}
# Functions
function h-pro() {
heroku $@ --app lu-production
}
# Fetch all remotes
function git_fetch_remotes() {
for remote in `git remote`
do
git fetch $remote
done
}
# Delete local branches that were already merged.
function git_prune_local_branches() {
flag=$1
branches=`git branch --merged | sed '/*/d' | sed '/master/d'`;
for branch in `echo $branches`
do
if [[ $flag = "-f" ]]
then
git branch -d $branch;
else
echo "Would delete $branch"
fi
done
}
# Delete remote merged branches that were already merged.
function git_prune_remote_branches() {
flag=$1
branches=`git branch -r --merged origin/master | grep 'origin/' | sed '/master/d'`
if [[ $flag = "-f" ]]
then
branches=`echo $branches | sed "s/origin\//:/g"`
git push origin $branches
git remote prune origin
else
for branch in `echo $branches`
do
echo "Would delete $branch"
done
fi
}
# Markdown and open in browser
function markdown() {
kramdown "$1" | bcat;
}
function bump_version() {
echo $1 > VERSION && git commit -m "Bump version to $1" -- VERSION && git tag "v$1"
}
function build_gem() {
gem build *.gemspec
}
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# 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 red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="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 ssh-agent gem heroku brew)
source $ZSH/oh-my-zsh.sh
# Disable reflow so that CTRL-Q works in vim.
stty -ixon
# Don't use autocorrection.
unsetopt correct_all
# Prevent setting paths multiple times:
# homebrew
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
# personal scripts
export PATH="$HOME/.scripts:$PATH"
# Node Packace Manager
export PATH="/usr/local/share/npm/bin:$PATH"
export PATH="./node_modules/.bin:$PATH"
# Python virtualenv
export PATH="$HOME/.virtualenv/default_env/bin:$PATH"
# Load rbenv
export PATH="$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# bundler binstubs
export PATH="./bin:$PATH"