-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
110 lines (89 loc) · 2.4 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
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set default user for powerline
DEFAULT_USER="akshayp"
# Set name of the theme to load.
ZSH_THEME="agnoster"
#Functions
function tree() {
if [ "$1" != "" ] #if parameter exists, use as base folder
then cd "$1"
fi
pwd
ls -R | grep ":$" | \
sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
# 1st sed: remove colons
# 2nd sed: replace higher level folder names with dashes
# 3rd sed: indent graph three spaces
# 4th sed: replace first dash with a vertical bar
if [ `ls -F -1 | grep "/" | wc -l` = 0 ] # check if no folders
then echo " -> no sub-directories"
fi
}
function gitfork() {
username=($whoami)
fork=$(sed 's//hello/')
git clone "$1"
repo=$(basename $1 .git)
echo "Changing directory to: " $repo
cd $repo
echo "Adding upstream"
git remote add upstream $1
}
# Aliases
# Old DOS habits
alias cls="clear"
alias clc="clear"
# Interactive/Safe Shell
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
alias mkdir='mkdir -p'
alias grep='grep -rn --color=auto --exclude-dir=".svn"'
# Shortcuts
alias h="history"
alias home="cd ~"
alias desktop="cd ~/Desktop"
alias download="cd ~/Downloads"
alias edit="subl"
alias e="subl"
alias c="http"
alias gitsync="git fetch upstream; git merge upstream/master; git push"
# System Stats
alias up="uptime"
alias sup="ps auxwww"
alias df="df -h"
#Plugins
plugins=(git colored-man docker extract git-extras node npm svn colorize)
source $ZSH/oh-my-zsh.sh
#Override
alias lst='tree'
# Exports
export NPM_PATH="/usr/local/share/npm"
export NODE_PATH="/usr/local/lib/node_modules:/usr/local/share/npm"
export GOPATH=$HOME/Dev/go
export GOROOT=/usr/local/go
export ANDROID_HOME=/usr/local/opt/android-sdk
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export PATH=$NPM_PATH/bin:$GOPATH/bin:$GOROOT/bin:/usr/local/bin:/usr/X11/bin:$PATH
export TERM="xterm-color"
export CLICOLOR="true"
export EDITOR='subl -n -w'
# History Management
HISTFILE=~/.history
export HISTSIZE=10000
export SAVEHIST=10000
setopt APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
#Autocompletion
eval "$(grunt --completion=zsh)"
#Local zsh overrides
if [ -e ~/.zsh_local ]; then
source ~/.zsh_local
fi
#Fix ulimit on OSX
ulimit -n 10000
fpath=(/usr/local/share/zsh-completions $fpath)
export PATH="$HOME/.yarn/bin:$PATH"