-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
65 lines (51 loc) · 1.75 KB
/
.zshrc
File metadata and controls
65 lines (51 loc) · 1.75 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
setopt IGNOREEOF
export LANG=ja_JP.UTF-8
autoload -Uz colors && colors
# completion
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
fpath=(~/.zsh/completion $fpath)
fpath=(/opt/homebrew/share/zsh/site-functions $fpath)
autoload -U compinit
compinit -u
# bash completionを使う
autoload -U +X bashcompinit && bashcompinit
alias ls="ls -ahlG"
alias diff="colordiff"
alias free="free -m"
# git ps1
if [[ -f ~/.zsh/git-prompt.sh ]]; then
source ~/.zsh/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
fi
# kube ps1
if [[ -f /opt/homebrew/opt/kube-ps1/share/kube-ps1.sh ]]; then
source /opt/homebrew/opt/kube-ps1/share/kube-ps1.sh
KUBE_PS1_SYMBOL_ENABLE=false
KUBE_PS1_SEPARATOR=''
KUBE_PS1_PREFIX='| '
KUBE_PS1_SUFFIX=''
KUBE_PS1_NS_ENABLE=false
fi
# PS1 settings
export PS1='%{${fg[cyan]}%}%D %* %{${fg[yellow]}%}%C %{${fg[green]}%}$(__git_ps1 "(%s)") %{${fg[magenta]}%}$(kube_ps1)
> %{${reset_color}%}'
export PS2='>'
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# terraform completion
if [[ -f /usr/local/bin/terraform ]]; then
complete -o nospace -C /usr/local/bin/terraform terraform
fi
export PATH="/opt/homebrew/bin:$PATH" >> ~/.zshrc
export GOPATH=$HOME/.go
# コマンド実行時に時刻上書き
re-prompt() {
zle .reset-prompt
zle .accept-line
}
# 1password ssh agent
mkdir -p ~/.1password && ln -sf ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ~/.1password/agent.sock
export SSH_AUTH_SOCK=~/.1password/agent.sock
zle -N accept-line re-prompt