-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
123 lines (92 loc) · 2.64 KB
/
dot_zshrc
File metadata and controls
123 lines (92 loc) · 2.64 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
# autoload
autoload -Uz colors && colors
autoload -Uz compinit && compinit
autoload -Uz promptinit && promptinit
autoload -Uz vcs_info && vcs_info
autoload -Uz add-zsh-hook
# completion
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# colors
export CLICOLOR=1
export LSCOLORS=exfxcxdxbxegedabagacad
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
# options
setopt share_history
setopt histignorealldups
setopt auto_cd
setopt prompt_subst
setopt correct
# History
export HISTFILE=~/.zhistory
export HISTSIZE=10000
export SAVEHIST=50000
# Key
bindkey -v
bindkey -M viins 'jj' vi-cmd-mode
# Aliases
alias g='git'
alias la='ls -a'
alias ll='ls -l'
alias F=' | fzf'
if [[ -x `which colordiff` ]]; then
alias diff='colordiff -u'
else
alias diff='diff -u'
fi
# p10k
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
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
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='ag --nocolor --hidden -g ""'
export FZF_DEFAULT_OPTS="--height 40% --reverse --border --preview 'head -20 {}'"
# asdf
if [ $(uname) = 'Darwin' ]; then
source $(brew --prefix asdf)/libexec/asdf.sh
fi
# functions
mt() {
cd $(ghq root)/github.com/mt-coff
}
ghcd() {
dir=$(ghq list | fzf)
if [[ -n "$dir" ]]; then
cd "$(ghq root)/$dir"
fi
}
gho() {
dir=$(ghq list | fzf)
if [[ -n "$dir" ]]; then
open "https://$dir"
fi
}
eval "$(direnv hook zsh)"
# zplug
if [ ! -e $HOME"/.zplug" ]; then
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
fi
source ~/.zplug/init.zsh
# Plugins
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions"
zplug "b4b4r07/enhancd", use:init.sh
zplug "mafredri/zsh-async"
zplug "romkatv/powerlevel10k", as:theme, depth:1
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
# compile
[[ ! -f ~/.zshrc.zwc || ~/.zshrc -nt ~/.zshrc.zwc ]] && zcompile ~/.zshrc
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/mt_coff/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/mt_coff/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/mt_coff/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/mt_coff/google-cloud-sdk/completion.zsh.inc'; fi
export PNPM_HOME="/Users/mt_coff/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"