-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zprofile
81 lines (64 loc) · 1.78 KB
/
.zprofile
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
eval "$(/opt/homebrew/bin/brew shellenv)"
# for Sheldon which is a plugin manager for zsh
eval "$(sheldon source)"
# 補完機能
autoload -U compinit
compinit
# prompt
PROMPT='%m:%c %n$ '
# keybind
bindkey \^U backward-kill-line
# コマンド履歴
HISTFILE=~/.zsh_history
HISTSIZE=6000000
SAVEHIST=6000000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
# コマンド履歴検索
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^P" history-beginning-search-backward-end
bindkey "^N" history-beginning-search-forward-end
# alias
alias diff="colordiff"
# for zsh
setopt nonomatch # *で補完が実行されないようにする
# for golang
export GOPATH=$HOME/go
export PATH=$HOME/go/bin:$PATH
# for python
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# for rye
source "$HOME/.rye/env"
# for nodejs
export PATH=$PATH:$HOME/.nodebrew/current/bin
# for tfenv(Terraform env)
export PATH="$HOME/.tfenv/bin:$PATH"
# for .z
source $HOME/.zsh.d/z.sh
# for peco
function peco-z-search
{
which peco z > /dev/null
if [ $? -ne 0 ]; then
echo "Please install peco and z"
return 1
fi
local res=$(z | sort -rn | cut -c 12- | peco)
if [ -n "$res" ]; then
BUFFER+="cd $res"
zle accept-line
else
return 1
fi
}
zle -N peco-z-search
bindkey '^]' peco-z-search
# for flutter
export PATH="$HOME/flutter/bin:$PATH"
# for google cloud
source '/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc'
source '/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'