-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc.orig
More file actions
165 lines (145 loc) · 4.78 KB
/
Copy pathzshrc.orig
File metadata and controls
165 lines (145 loc) · 4.78 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
source /etc/profile
#source /etc/zsh/zprofile
[ -f ~/.profile ] && source ~/.profile
setopt APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt AUTO_CD
setopt CORRECT_ALL
setopt PROMPT_SUBST
autoload -U zkbd
autoload -U compinit
compinit
autoload -U promptinit && promptinit
#prompt gentoo
fpath=(~/.zsh/functions $fpath)
autoload -U ~/.zsh/functions/*(:t)
#PREPROMPT='%B%F{yellow}%*%f%b '
PREPROMPT=''
local git_prompt='%B%F{yellow}$(git_info_for_prompt)%f%b'
local rvm_prompt='%B%F{red}$(rvm_ruby_prompt)%f%b'
AFTERPROMPT="${git_prompt}"
if [[ ${USERNAME} = 'root' ]]; then
PROMPT="${PREPROMPT}%B%F{red}%m%k %B%F{blue}%1~${AFTERPROMPT}%B%F{blue} %# %b%f%k"
else
PROMPT="${PREPROMPT}%B%F{green}%n@%m%k %B%F{blue}%1~${AFTERPROMPT}%B%F{blue} %# %b%f%k"
fi
export PROMPT
#export RPROMPT="%F{yellow}(%?)[%h]%f"
export RPROMPT="${rvm_prompt}"
#limit stack 8192
#limit core 0
zstyle ':completion:*' menu yes select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:processes' command 'ps xua'
zstyle ':completion:*:processes' sort false
zstyle ':completion:*:processes-names' command 'ps xho command'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b)#([0-9]#)*=0=01;31'
[ -f ~/.zsh/git-flow-completion/git-flow-completion.zsh ] && source ~/.zsh/git-flow-completion/git-flow-completion.zsh
#
export HISTFILE="${HOME}/.zhistory"
export SAVEHIST=5000
export HISTSIZE=5000
export DIRSTACKSIZE=20
[[ $OSTYPE == linux* ]] && eval `dircolors`
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'
if [ -f /usr/bin/grc ]; then
alias ping="grc --colour=auto ping"
alias traceroute="grc --colour=auto traceroute"
alias make="grc --colour=auto make"
alias diff="grc --colour=auto diff"
alias cvs="grc --colour=auto cvs"
alias netstat="grc --colour=auto netstat"
fi
bindkey -v
case ${TERM} in
xterm*|rxvt)
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
preexec () { print -Pn "\e]0;%n@%m: $1\a" }
;;
screen)
precmd () { print -Pn "\033k%~\033\\" }
preexec () { print -Pn "\033k$1\033\\" }
;;
esac
case ${TERM} in
linux|screen|screen.linux)
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[e" expand-cmd-path # C-e for expanding path of typed command
bindkey "^[[A" up-line-or-search # up arrow for back-history-search
bindkey "^[[B" down-line-or-search # down arrow for fwd-history-search
bindkey " " magic-space # do history expansion on space
;;
*xterm*|rxvt|(dt|k|E)term)
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^E" expand-cmd-path
bindkey "^[[A" up-line-or-search
bindkey "^[[B" down-line-or-search
bindkey " " magic-space
;;
esac
alias zreload='source ~/.zshrc'
alias viz='vim ~/.zshrc'
alias ls='ls -aFG'
alias df='df -h'
alias du='du -h'
alias mxterm='xterm -fn "-*-terminus-*-r-normal-*-12-120-*-*-*-*-*-cp1251"'
alias mv='nocorrect mv -i'
alias cp='nocorrect cp -iR'
alias rm='nocorrect rm -i'
alias rmf='nocorrect rm -f'
alias rmrf='nocorrect rm -fR'
alias mkdir='nocorrect mkdir'
alias h=history
#alias grep=egrep
alias df='df -m'
alias less='less -RMS'
alias ispell='ispell -d russian'
[[ $OSTYPE == linux* ]] && alias ls='ls -F --color=auto'
alias ll='ls -l'
alias la='ls -A'
alias li='ls -ial'
alias lsd='ls -ld *(-/DN)'
alias lsa='ls -ld .*'
alias -g M='|more'
alias -g L='|less'
alias -g H='|head'
alias -g T='|tail'
alias -g N='2>/dev/null'
alias vi='vim'
#MANPAGER='/usr/bin/most -s'
MANPAGER="less -RMS"
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
export SCIPY_PIL_IMAGE_VIEWER=okular
export EDITOR="subl -w"
# Since I use sudo including admin path
PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}"
[[ -x ${HOME}/.rvm/scripts/rvm ]] && source ${HOME}/.rvm/scripts/rvm
[[ -d ${HOME}/scripts ]] && PATH="${HOME}/scripts:${PATH}"
[[ -d ${HOME}/bin ]] && PATH="${HOME}/bin:${PATH}"
[[ -f ${HOME}/.aliases ]] && source ${HOME}/.aliases
[[ -e ${HOME}/.zshrc.${OSTYPE} ]] && source ${HOME}/.zshrc.${OSTYPE}
[[ -e ${HOME}/.zshrc.local ]] && source ${HOME}/.zshrc.local
unset RUBYOPT
### Added by the Heroku Toolbelt
PATH="/usr/local/heroku/bin:$PATH"
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH