-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
125 lines (94 loc) · 3.41 KB
/
dot_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
# options
stty -ixon # Disable C-s
disable r # disable "r" command
setopt list_packed # 補完候補を詰めて表示する
setopt nolistbeep # 補完候補表示時などにピッピとビープ音をならないように設定
setopt ignoreeof
bindkey -e # emacs key bind
autoload bashcompinit && bashcompinit
# Set up completion
autoload -U compinit
compinit -u
fpath=(~/.zsh/completion $fpath)
zstyle ':completion:*' verbose yes
zstyle ':completion:*' format '%B%d%b'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors di=34 ln=35 ex=31 #補完に色をつける
# general-purposed bin directory
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
# include .zshrc_private
if [ -f "$HOME/.zshrc_private" ]; then
source $HOME/.zshrc_private
fi
# set up afx
type afx > /dev/null 2>&1 && eval "$(afx init)"
type afx > /dev/null 2>&1 && eval "$(afx completion zsh)"
type afx > /dev/null 2>&1 && compdef _afx afx
# Set up editor
export EDITOR=vim
type nvim > /dev/null 2>&1 && export EDITOR=nvim
# set up alias
source $HOME/.config/zsh/alias.zsh
# set up ghq
source $HOME/.config/zsh/ghq.zsh
# config around cd / ls
source $HOME/.config/zsh/ls.zsh
bindkey '^J' self-insert #C-jで改行
# Startship (prompt)
type starship > /dev/null 2>&1 && eval "$(starship init zsh)"
# C-zでfgを実行
function run-fglast {
zle push-input
BUFFER="fg %"
zle accept-line
}
zle -N run-fglast
bindkey "^z" run-fglast
# Command history config
HISTFILE=~/.zsh_history
HISTSIZE=6000000
SAVEHIST=6000000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
setopt hist_ignore_space
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
# edit-command-line
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^O' edit-command-line
# PlatformIO
export PATH="$HOME/.platformio/penv/bin:$PATH"
# XXXenv
type anyenv > /dev/null 2>&1 && eval "$(anyenv init -)"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
type pyenv > /dev/null 2>&1 && eval "$(pyenv init -)"
type direnv > /dev/null 2>&1 && eval "$(direnv hook zsh)"
type xienv > /dev/null 2>&1 && eval "$(xienv init -)"
# flutter
export PATH="$PATH:$HOME/flutter/flutter/bin:$HOME/.pub-cache/bin"
# The next line updates PATH for the Google Cloud SDK.
if [ -f "$HOME/bin/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/bin/google-cloud-sdk/path.zsh.inc"; fi
if [ -f "$HOME/bin/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/bin/google-cloud-sdk/completion.zsh.inc"; fi
# golang
export GO111MODULE=on
export PATH="/usr/local/go/bin:$PATH"
# chezmoi completion
type chezmoi > /dev/null 2>&1 && eval "$(chezmoi completion zsh)"
type minikube > /dev/null 2>&1 && alias kubectl="minikube kubectl --"
# deno
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
# add completion for aws cli
complete -C $(which aws_completer) aws
type neofetch > /dev/null 2>&1 && neofetch
export PICO_SDK_PATH=$HOME/ghq/github.com/raspberrypi/pico-sdk
# gstreamer
export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin:$PATH"