-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
107 lines (84 loc) · 2.38 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
# zsh setup and prompt borrowed from @pilif (https://github.com/pilif)
function check_path(){
which $1 2>&1 > /dev/null
}
export EDITOR="vim"
export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "^r" history-incremental-search-backward
setopt nonomatch
case $TERM in
*xterm*|ansi)
# Put the penultimate and current directory in the iterm tab:
function settab { print -Pn "\e]1;%n@%m: %~\a" }
# Put the string " [zsh] hostname::/full/directory/path" in the title bar:
function settitle { print -Pn "\e]2;%n@%m: %~\a" }
# This updates before each prompt:
precmd () { settab;settitle }
settab;settitle
;;
esac
setopt INC_APPEND_HISTORY EXTENDED_HISTORY HIST_IGNORE_DUPS HIST_EXPIRE_DUPS_FIRST HIST_SAVE_NO_DUPS AUTO_CD AUTO_PUSHD NO_BEEP LIST_AMBIGUOUS AUTO_MENU
########################
# PATH
export PATH="/usr/local/bin:$PATH:$HOME/bin"
if [ `uname -s` = "Linux" ]; then
export PATH="$HOME/opt/android-sdk-linux_x86/tools:$PATH"
export PATH="$HOME/opt/android-sdk-linux_x86/platform-tools:$PATH"
fi
if [ `uname -s` = "Darwin" ]; then
# android sdk
export PATH=$PATH:$HOME/opt/android-sdk/tools
export PATH=$PATH:$HOME/opt/android-sdk/platform-tools
fi
########################
# Aliases
alias vi=vim
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias p='ps aux'
alias g='git'
alias gs='git status -s'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git log --pretty=oneline --format="%cd %H %N %s" --no-merges'
alias grl='git log --reverse --pretty=oneline'
if [ `uname -s` = "Linux" ]; then
alias search='apt-cache search'
alias show='apt-cache show'
alias open='gnome-open'
alias ls='ls --color=auto'
fi
if [ `uname -s` = "Darwin" ]; then
if check_path 'gsed'; then
alias sed=gsed
fi
if check_path 'gfind'; then
alias find=gfind
fi
alias ls='ls -G'
fi
########################
echo "autoloading functions..."
fpath=(~/.zshfunc $fpath)
autoload -U promptinit
autoload -U compinit
echo "init completitions..."
compinit
echo "init prompt..."
promptinit
if [[ $ZSH_VERSION == "4.3.4" ]]; then
prompt pilif
else
prompt pilif2 green blue green
fi