-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
86 lines (74 loc) · 2.35 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
eval "$(starship init zsh)"
if [[ $(command -v exa) ]]; then
alias e='exa --icons --git'
alias l=e
alias ls=e
alias ea='exa -a --icons --git'
alias la=ea
alias ee='exa -aahl --icons --git'
alias ll=ee
alias et='exa -T -L 3 -a -I "node_modules|.git|.cache" --icons'
alias lt=et
alias eta='exa -T -a -I "node_modules|.git|.cache" --color=always --icons | less -r'
alias lta=eta
alias l='clear && ls'
fi
if [ -e $HOME/.asdf/asdf.sh ]
then
. $HOME/.asdf/asdf.sh
fi
# k8s
source <(kubectl completion zsh)
### cd ghq project
function ghq-fzf() {
local src=$(ghq list | fzf --layout=reverse --preview "bat --color=always --style=header,grid --line-range :80 $(ghq root)/{}/(README|readme).*")
if [ -n "$src" ]; then
BUFFER="cd $(ghq root)/$src"
zle accept-line
fi
zle -R -c
}
zle -N ghq-fzf
bindkey '^]' ghq-fzf
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Plugin history-search-multi-word loaded with investigating.
zinit load zdharma-continuum/history-search-multi-word
# Two regular plugins loaded without investigating.
zinit light zsh-users/zsh-autosuggestions
zinit light zdharma-continuum/fast-syntax-highlighting
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f ~/.kubectl_aliases ] && source ~/.kubectl_aliases
alias g="env"
# Options
setopt share_history # Share history
setopt hist_ignore_dups
#setopt hist_ignore_all_dups
setopt hist_reduce_blanks
setopt correct
setopt auto_pushd
setopt pushd_ignore_dups
setopt auto_cd
setopt extended_glob
autoload -Uz colors
colors
setopt print_eight_bit
HISTFILE=~/.zsh_history
HISTSIZE=100000
SAVEHIST=100000
zstyle ':completion:*:default' menu select=1
# ENV
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
eval "$(gh completion -s zsh)"
autoload -Uz compinit
compinit