forked from strozw/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
175 lines (136 loc) · 4.92 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
######################################################
# User PATH
#######################################################
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
# rust
source $HOME/.cargo/env
export JAVA_HOME=$(/usr/libexec/java_home --version=1.8)
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/[email protected]"
export PATH="/usr/local/opt/ruby/bin:$PATH" export LDFLAGS="-L/usr/local/opt/ruby/lib" export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
# Added by serverless binary installer
export PATH="$HOME/.serverless/bin:$PATH"
#######################################################
# anyenv
#######################################################
# export PATH="$HOME/.anyenv/bin:$PATH"
# eval "$(anyenv init -)"
#######################################################
# nextword
#######################################################
export NEXTWORD_DATA_PATH="$HOME/.config/nextword/nextword-data-small"
#######################################################
# asdf
#######################################################
. $HOME/.asdf/asdf.sh
#######################################################
# direnv
#######################################################
eval "$(direnv hook zsh)"
#######################################################
# alias
#######################################################
alias cp='cp -i'
alias mv='mv -i'
# alias rm='rm -i'
alias rm='gomi'
# alias ls='gls -GAF --color=auto'
alias ls='lsd -AF'
alias ll='ls -l'
# alias ll='exa -lgh --git'
# alias exa='exa -aF'
alias less='less -R'
alias bat='bat --theme TwoDark'
# FZF_PREVIEW_PREVIEW_BAT_THEME=base16
#######################################################
# tabtab (https://github.com/mklabs/tabtab)
# tab completion helper by node.js
#######################################################
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/__tabtab.zsh ]] && . ~/.config/tabtab/__tabtab.zsh || true
#######################################################
# broot (https://github.com/Canop/broot)
#######################################################
source /Users/satoruohzawa/.config/broot/launcher/bash/br
#------------------------------------------------------
# keymap
#------------------------------------------------------
# emacs mode
# If bindkey is undefined and EDITOR enviroment is vim in zshrc or zprofile, key binding seems to be in vim mode in child process zsh.
# ref: https://web-salad.hateblo.jp/entry/2014/12/07/090000
bindkey -e
#######################################################
# zinit
#######################################################
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
### End of Zinit's installer chunk
zinit light yous/vanilli.sh
zinit wait lucid light-mode for \
agkozak/zsh-z \
atinit"zicompinit; zicdreplay" \
zdharma/fast-syntax-highlighting \
ascii-soup/zsh-url-highlighter \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
# completion for git
zinit wait lucid is-snippet for \
OMZL::git.zsh \
OMZP::git \
# OMZP::docker/_docker \
# OMZP::docker-compose/_docker-compose \
#######################################################
# fzf
#######################################################
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
bindkey '^X^T' fzf-file-widget
bindkey '^T' transpose-chars
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"'
export FZF_LEGACY_KEYBINDINGS=1
export FZF_DEFAULT_OPTS='
--bind="F2:toggle-preview"
--layout=reverse
--preview "bat --theme={} --color=always"
'
# fzf z
function fzf-z () {
local selected_dir=$(z -t | sort -nr | awk '{ print $2 }' | fzf)
if [ -n "$selected_dir" ]; then
#buffer="cd ${selected_dir}"
cd ${selected_dir}
zle accept-line
fi
zle clear-screen
}
zle -N fzf-z
bindkey '^@' fzf-z
# ghq
function fzf-ghq () {
cd $(ghq list -p | fzf)
zle accept-line
zle clear-screen
}
zle -N fzf-ghq
bindkey '^_' fzf-ghq
# docker
source ~/ghq/github.com/kwhrtsk/docker-fzf-completion/docker-fzf.zsh
#######################################################
# starship
# prompt
#######################################################
eval "$(starship init zsh)"