-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
123 lines (103 loc) · 2.68 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
autoload -U colors
colors
fpath=($(brew --prefix)/share/zsh/site-functions $fpath)
setopt always_last_prompt
setopt always_to_end
setopt append_history
setopt auto_cd
setopt auto_list
setopt auto_menu
setopt auto_param_keys
setopt auto_param_slash
setopt auto_pushd
setopt auto_remove_slash
setopt complete_in_word
setopt correct
#setopt correct_all
#setopt glob_complete
setopt extended_glob
setopt extended_history
setopt hist_ignore_all_dups
setopt list_types
setopt long_list_jobs
#setopt magic_equal_subst
setopt nobeep
setopt print_eight_bit
setopt pushd_ignore_dups
setopt share_history
unsetopt promptcr
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
autoload -U compinit
compinit -u
zstyle ':completion:*:default' menu select=1
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
compdef _tex platex
HISTFILE="$HOME/.zhistory"
HISTSIZE=100000
SAVEHIST=100000
bindkey -e
bindkey '^P' history-beginning-search-backward
bindkey '^N' history-beginning-search-forward
if [ $(uname) = 'Darwin' ]; then
LS_OPTIONS=-FG
alias -g CP='| pbcopy'
export __CF_USER_TEXT_ENCODING='0x1F5:0x08000100:14'
elif [ $(uname) = 'Linux' ]; then
LS_OPTIONS=-F --color
fi
alias ls='ls -G'
alias ll='ls -lh'
alias la='ll -a'
alias rm='rm -i'
alias cp='cp -v'
alias mv='mv -iv'
alias tree='tree -NC'
alias vim='nvim'
alias ce='carton exec'
alias be='bundle exec'
alias -g L='| $PAGER'
alias -g G='| grep'
if [[ "$TERM" == "xterm-256color" || "$TERM" == "xterm" ]]; then
chpwd () { echo -n "_`dirs`\\" }
preexec() {
# see [zsh-workers:13180]
# http://www.zsh.org/mla/workers/2000/msg03993.html
emulate -L zsh
local -a cmd; cmd=(${(z)2})
case $cmd[1] in
fg)
if (( $#cmd == 1 )); then
cmd=(builtin jobs -l %+)
else
cmd=(builtin jobs -l $cmd[2])
fi
;;
%*)
cmd=(builtin jobs -l $cmd[1])
;;
cd)
if (( $#cmd >= 2)); then
cmd[1]=$cmd[2]
fi
;;
*)
echo -n "k$cmd[1]:t\\"
return
;;
esac
local -A jt; jt=(${(kv)jobtexts})
$cmd >>(read num rest
cmd=(${(z)${(e):-\$jt$num}})
echo -n "k$cmd[1]:t\\") 2>/dev/null
}
chpwd
fi
REPORTTIME=10
for f (~/.zsh/**/*.zsh) source "${f}"
eval "$(starship init zsh)"
# https://github.com/junegunn/fzf#using-homebrew
# $(brew --prefix)/opt/fzf/install
export FZF_CTRL_R_OPTS="--height=100%"
eval "$(fzf --zsh)"
. $(brew --prefix asdf)/libexec/asdf.sh