-
Notifications
You must be signed in to change notification settings - Fork 3
/
zshrc_linux
74 lines (65 loc) · 2.01 KB
/
zshrc_linux
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
export PYTHONENV=$HOME/Envs/Python-2.7.5
export PYTHONSTARTUP=$HOME/.pythonrc.py
export PATH=$PYTHONENV/bin:$PATH
# for virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=$PYTHONENV/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=$PYTHONENV/bin/virtualenv
export WORKON_HOME=$PYTHONENV/virtualenvs
source $PYTHONENV/bin/virtualenvwrapper.sh
function switch_python() {
if [[ ${PATH#$PYTHONENV/bin} == $PATH ]]; then
echo 'Switch to make-installed Python'
export PATH=$PYTHONENV/bin:$PATH
else
echo 'Switch to system Python'
export PATH=${PATH#$PYTHONENV/bin}
fi
}
alias enca_utf8="enca -L zh_CN -x utf-8"
alias pdb="python -m pdb"
alias tree="tree --dirsfirst"
# List only directories
alias lla='ls -la'
# File size
alias fs="stat -f \"%z bytes\""
alias sublime="/home/reorx/Applications/SublimeText2/sublime_text"
alias t='python ~/workspace/lab/t/t.py --task-dir /home/reorx/Documents/Tasks --list tasks.txt --delete-if-empty'
alias ack="ack-grep"
#alias git="hub"
hash -d desktop="/home/reorx/Desktop"
hash -d music="/home/reorx/Music"
hash -d pictures="/home/reorx/Pictures"
hash -d downloads="/home/reorx/Downloads"
hash -d documents="/home/reorx/Documents"
hash -d applications="/home/reorx/Applications"
hash -d dropbox="/home/reorx/Dropbox"
hash -d workspace="/home/reorx/workspace"
hash -d current="/home/reorx/workspace/current"
hash -d lab="/home/reorx/workspace/lab"
function dp() {
dolphin $@ &
}
# extract archives -- usage: extract <file>
function extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip "$1" ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
function use_proxy() {
export http_proxy="$(cat ~/.shell_proxy)"
}