-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
executable file
·156 lines (112 loc) · 3.66 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
#!/usr/bin/zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
#echo 'zshrc' $0 # Debug
# Profiling
# zmodload zsh/zprof
zstyle ':completion:*' completer _expand _complete _ignored _approximate
zstyle :compinstall filename "$HOME/.zshrc"
zstyle ':completion:*' accept-exact '*(N)'
if type brew >/dev/null 2>&1; then
fpath+=$BREW_PREFIX/share/zsh/site-functions
fi
fpath+=~/.zsh/Completion
setopt autocd nomatch
# zle uses vi mode
bindkey -v
# append history list to the history file; this is the default but we make sure
# because it's required for share_history.
setopt APPEND_HISTORY
# import new commands from the history file also in other zsh-session
setopt SHARE_HISTORY
# if a command is issued that can't be executed as a normal command, and the
# command is the name of a directory, perform the cd command to that directory.
setopt auto_cd
# in order to use #, ~ and ^ for filename generation grep word
# *~(*.gz|*.bz|*.bz2|*.zip|*.Z) -> searches for word not in compressed files
# don't forget to quote '^', '~' and '#'!
setopt extended_glob
# display PID when suspending processes as well
setopt longlistjobs
# report the status of backgrounds jobs immediately
setopt notify
# whenever a command completion is attempted, make sure the entire command path
# is hashed first.
setopt hash_list_all
# Don't send SIGHUP to background processes when the shell exits.
setopt nohup
# make cd push the old directory onto the directory stack.
setopt auto_pushd
# avoid "beep"ing
setopt nobeep
# don't push the same dir twice.
setopt pushd_ignore_dups
# * shouldn't match dotfiles. ever.
setopt noglobdots
# use zsh style word splitting
setopt noshwordsplit
zstyle :omz:plugins:ssh-agent agent-forwarding on
source $HOME/.zsh/plugins.zsh
# Set editor
set -o vi
# Colors
autoload -U colors && colors
setopt prompt_subst
# ZSH Hooks
autoload -U add-zsh-hook
# BASH completions (used for pipx)
autoload -U bashcompinit
bashcompinit
# source antidote
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
# Disable correct
if [ -f ~/.zsh_nocorrect ]; then
while read -r COMMAND; do
alias $COMMAND="nocorrect $COMMAND"
done <~/.zsh_nocorrect
fi
# all of our zsh files
typeset -U config_files
config_files=(~/.zsh/*.zsh~*/plugins.zsh) # Exlude .zsh/plugins.zsh from sourcing again
# load the path files
for file in "${config_files[@]}"; do
source "$file"
done
init_files=(~/.zsh/init/*.*sh)
for file in "${init_files[@]}"; do
source "$file" || true
done
tmux list-sessions 2>/dev/null
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
. ~/.asdf/plugins/java/set-java-home.zsh
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
source /Users/TSD/.config/op/plugins.sh
# Profiling end
# zprof
# unsetopt XTRACE
# exec 2>&3 3>&-
#compdef gt
###-begin-gt-completions-###
#
# yargs command completion script
#
# Installation: gt completion >> ~/.zshrc
# or gt completion >> ~/.zprofile on OSX.
#
_gt_yargs_completions()
{
local reply
local si=$IFS
IFS=$'
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" gt --get-yargs-completions "${words[@]}"))
IFS=$si
_describe 'values' reply
}
compdef _gt_yargs_completions gt
###-end-gt-completions-###