-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
128 lines (102 loc) · 2.89 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# ~/.zshrc
#
# completion
autoload -U compinit
compinit
setopt correct
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# history
HISTFILE=~/.zsh_history
HISTSIZE=10000000
SAVEHIST=10000000
setopt hist_ignore_dups # 前と重複する行は記録しない
setopt hist_ignore_all_dups # 履歴中の重複行をファイル記録前に無くす
setopt hist_find_no_dups # 履歴検索中の重複を飛ばす
setopt share_history
setopt auto_pushd
setopt pushd_ignore_dups
function peco-select-history() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(\history -n 1 | \
eval $tac | \
peco --query "$LBUFFER")
CURSOR=$#BUFFER
zle clear-screen
}
zle -N peco-select-history
bindkey '^r' peco-select-history
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export EDITOR=vim
eval "$(rbenv init -)"
alias bt='bin/rails test'
alias be='bundle exec'
alias bi='bundle install'
alias bo='bundle open'
alias bu='bundle update'
alias br='bundle exec rspec'
alias yi='yarn install'
alias ci='curl -I'
alias db='docker-compose build'
alias du='docker-compose up'
alias de='docker-compose exec'
alias dr='docker-compose run --rm'
alias drmpid='docker-compose run --rm rm tmp/pids/server.pid'
alias g='git'
alias gst='git status -s -b'
alias r='rails'
alias o='open'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls -G'
alias mkdir='mkdir -p'
alias e='emacs'
alias v='vim'
alias r='rails'
alias rwbr='RUBYOPT=-w bundle exec rake'
alias ..="cd .."
# ビープ音を鳴らさないようにする
setopt no_beep
# ディレクトリ名だけでcdする
setopt auto_cd
setopt nonomatch
source ~/.zplug/init.zsh
# Set the priority when loading
# e.g., zsh-syntax-highlighting must be loaded
# after executing compinit command and sourcing other plugins
# (If the defer tag is given 2 or above, run after compinit command)
zplug "zsh-users/zsh-syntax-highlighting", defer:2
# Then, source plugins and add commands to $PATH
zplug load --verbose
#prompt
#autoload -U colors
#colors
autoload -Uz vcs_info
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "%F{yellow}!"
zstyle ':vcs_info:git:*' unstagedstr "%F{red}+"
zstyle ':vcs_info:*' formats "%F{green}%c%u[%b]%f"
zstyle ':vcs_info:*' actionformats '[%b|%a]'
precmd () { vcs_info }
RPROMPT='[%F{green}%d%f]'
RPROMPT=$RPROMPT'${vcs_info_msg_0_}'
# start ssh agent
SSH_AGENT_FILE=$HOME/.ssh/ssh-agent
test -f $SSH_AGENT_FILE && source $SSH_AGENT_FILE
if ! ssh-add -l > /dev/null 2>&1; then
ssh-agent > $SSH_AGENT_FILE
source $SSH_AGENT_FILE
ssh-add $HOME/.ssh/swamp09
fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion