-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
147 lines (115 loc) · 5.65 KB
/
Copy path.zshrc
File metadata and controls
147 lines (115 loc) · 5.65 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# sheldon
eval "$(sheldon source)"
####################
# シェル設定
####################
# 新しく入れたコマンドを即認識する
zstyle ":completion:*:commands" rehash 1
# 色を有効化
autoload -Uz colors && colors
# https://qiita.com/maejimayuto/items/01216e6255c156fa7bf4
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # 補完候補で、大文字・小文字を区別しないで補完出来るようにするが、大文字を入力した場合は区別する
zstyle ':completion:*' ignore-parents parent pwd .. # ../ の後は今いるディレクトリを補間しない
zstyle ':completion:*:default' menu select=1 # 補間候補一覧上で移動できるように
zstyle ':completion:*:cd:*' ignore-parents parent pwd # 補間候補にカレントディレクトリは含めない
# 補完候補が多い場合の制御
LISTMAX=30 # 30個以上候補がある場合は確認を求める
zstyle ':completion:*' list-max-items 100 # 最大100個まで候補を表示
zstyle ':completion:*' use-cache true # 補完をキャッシュして高速化
zstyle ':completion:*' cache-path ~/.zsh/cache # キャッシュファイルの保存先
HISTFILE=~/.zsh_history
HISTSIZE=1000000
SAVEHIST=1000000
# setopt share_history # 履歴を他のシェルとリアルタイム共有する
setopt hist_ignore_all_dups # 同じコマンドをhistoryに残さない
setopt hist_ignore_space # historyに保存するときに余分なスペースを削除する
setopt hist_reduce_blanks # historyに保存するときに余分なスペースを削除する
setopt hist_save_no_dups # 重複するコマンドが保存されるとき、古い方を削除する
setopt inc_append_history # 実行時に履歴をファイルにに追加していく
setopt auto_cd # cdコマンドを省略してディレクトリに移動できるようにする
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
if [ -e /usr/local/share/zsh-completions ]; then
fpath=(/usr/local/share/zsh-completions $fpath)
fi
autoload -Uz compinit
compinit -u
####################
# 環境変数
####################
export LANG=ja_JP.UTF-8
export LC_CTYPE=ja_JP.UTF-8
# poetry
export PATH="$HOME/.local/bin:$PATH"
# gcloud
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PYENV_ROOT/shims:$PATH"
# gcp
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
# rust
export PATH="/usr/local/go/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
# cuda
# export PATH = /usr/local/cuda-11.8/bin
# export LD_LIBRARY_PATH = /usr/local/cuda-11.8/lib64
# wezterm
export PATH="/Applications/WezTerm.app/Contents/MacOS:$PATH"
# nodebrew
export PATH="$HOME/.nodebrew/current/bin:$PATH"
####################
# エイリアス
####################
# .envの仮想環境を読み込む
alias dotenv="set -a && source ~/.env && set +a"
# tmuxでよく使うペイン構成を作成
alias ide="bash ~/.script/ide.sh"
# ghqリポジトリをfzfで選択してtmuxセッションを開く
export PATH="$HOME/ghq/github.com/kuto5046/dotfiles/.bin:$PATH"
####################
# 勝手に追加されるもの
####################
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
eval "$(direnv hook zsh)"
export AQUA_GLOBAL_CONFIG="$HOME/.config/aquaproj-aqua/aqua.yaml"
export PATH="$(aqua root-dir)/bin:$PATH"
# mise (aquaより後に設定することでmiseのツールを優先)
eval "$(mise activate zsh)"
# miseのaquaバックエンドがuvのパスを正しく解決できないため明示的に追加
export PATH="$HOME/.local/share/mise/installs/uv/latest/uv-aarch64-apple-darwin:$PATH"
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/kyohei.uto.002/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/kyohei.uto.002/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/kyohei.uto.002/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/kyohei.uto.002/google-cloud-sdk/completion.zsh.inc'; fi
# opencode
export PATH=~/.opencode/bin:$PATH
export NPM_CONFIG_PREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/npm-global"
export PATH=$NPM_CONFIG_PREFIX/bin:$PATH
# Cortex CLI completion (disable via /settings in cortex)
[[ -s ~/.zsh/completions/cortex.zsh ]] && source ~/.zsh/completions/cortex.zsh
# Start ssh-agent automatically
if [ -z "$SSH_AUTH_SOCK" ]; then
eval "$(ssh-agent -s)" > /dev/null
ssh-add ~/.ssh/id_ed25519 2> /dev/null
fi
# 開発環境設定
# source ~/.zshrc.bakuraku
export AQUA_GLOBAL_CONFIG="/Users/kyohei.uto.002/.config/aquaproj-aqua/aqua.yaml"
export PATH="$PATH":"$HOME/.pub-cache/bin"
## [Completion]
## Completion scripts setup. Remove the following line to uninstall
[[ -f /Users/kyohei.uto.002/.dart-cli-completion/zsh-config.zsh ]] && . /Users/kyohei.uto.002/.dart-cli-completion/zsh-config.zsh || true
## [/Completion]
export PATH="$PATH":"$HOME/fvm/default/bin"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"