-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
105 lines (80 loc) · 1.98 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
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
if [ $UID = 0 ]; then
unset HISTFILE
SAVEHIST=0
fi
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt hist_save_no_dups
bindkey -e
autoload -U colors && colors
setopt prompt_subst
setopt auto_cd
setopt auto_pushd
setopt pushd_ignore_dups
setopt list_packed
setopt complete_aliases
setopt noautoremoveslash
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
/usr/sbin /usr/bin /sbin /bin
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*:default' menu select
#RVM
[[ -s "/Users/ryumu/.rvm/scripts/rvm" ]] && source "/Users/ryumu/.rvm/scripts/rvm"
function rvm_info_for_prompt {
ruby_version=$(~/.rvm/bin/rvm-prompt)
if [ -n "$ruby_version" ]; then
echo "%F{magenta}($ruby_version)%f"
fi
}
autoload -Uz vcs_info
zstyle ':vcs_info:*' formats '(%s)-[%b]'
zstyle ':vcs_info:*' actionformats '(%s)-[%b|%a]'
precmd_vcs_info() {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
typeset -ga precmd_functions
precmd_functions+=precmd_vcs_info
PROMPT=$'%{\e[32m%}$LOGNAME@${WINDOW:+"[$WINDOW]"}%B:%b%{\e[m%}[%~]$(rvm_info_for_prompt)%1(v|%F{green}%1v%f|)\n%% '
# ^で上のディレクトリ
function cdup() {
echo
cd ..
zle reset-prompt
}
zle -N cdup
bindkey '\^' cdup
#alias
case "${OSTYPE}" in
freebsd*|darwin*)
alias ls="ls -G -w -F"
;;
linux*)
alias ls="ls --color"
;;
esac
alias ll="ls -l"
alias la="ls -a"
alias du="du -h"
alias df="df -h"
alias su="su -l"
case "${TERM}" in
kterm*|xterm*)
precmd() {
echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD}\007"
}
export LSCOLORS=exfxcxdxbxegedabagacad
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
zstyle ':completion:*' list-colors \
'di=34' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;34'
;;
esac
__rvm_project_rvmrc
cd .