-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
85 lines (70 loc) · 1.6 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
# Homebrew
export PATH=/opt/homebrew/bin:"$PATH"
# Editor
export EDITOR=vi
# direnv Setup [https://direnv.net/docs/hook.html]
eval "$(direnv hook zsh)"
# peco
find_cd() {
cd "$(find . -type d | peco)"
}
# Google Search by Google Chrome
google() {
local str opt
if [ $# != 0 ]; then
for i in $*; do
str="$str${str:++}$i"
done
opt='search?num=100'
opt="${opt}&q=${str}"
fi
open -a Google\ Chrome http://www.google.co.jp/$opt
}
autoload -U compinit
compinit -u
# anyenv
eval "$(anyenv init -)"
# goenv
export PATH="$PATH":"$GOPATH/bin"
# prompt
PROMPT="%{${fg[blue]}%}[%~]%{${reset_color}%}%% "
PROMPT2="%_%% "
SPROMPT="%r is correct? [n,y,a,e]:] "
# ls color
export LSCOLORS=gxfxcxdxbxegedabagacad
setopt auto_cd
setopt correct
# git
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='${vcs_info_msg_0_}'
# alias setting
alias ls='ls -Grt'
alias ll='ls -l'
alias relogin='exec $SHELL -l'
alias fcd='find_cd'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias topmem='top -o rsize'
alias topcpu='top -o cpu'
alias k=kubectl
alias g=gcloud
alias -g A='| awk'
alias -g C='| wc -l'
alias -g G='| grep --color=auto'
alias -g H='| head'
alias -g L='| less -R'
alias -g T='| tail'
alias -g X='| xargs'
alias -s gz='tar -xzvf'
alias -s html='open'
function chpwd() { ls -ltr }