-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
144 lines (116 loc) · 6.5 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
# ============================================================================
# Options
# ============================================================================
# https://github.com/sorin-ionescu/prezto/blob/master/modules/history/init.zsh
HISTFILE="$HOME/.zsh_history" # The path to the history file.
HISTSIZE=10000 # The maximum number of events to save in the internal history.
SAVEHIST=10000 # The maximum number of events to save in the history file.
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing non-existent history.
# https://github.com/sorin-ionescu/prezto/blob/master/modules/environment/init.zsh
setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents)
# with the base character.
setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed.
setopt LONG_LIST_JOBS # List jobs in the long format by default.
setopt AUTO_RESUME # Attempt to resume existing job before creating a new process.
setopt NOTIFY # Report status of background jobs immediately.
unsetopt BG_NICE # Don't run all background jobs at a lower priority.
unsetopt HUP # Don't kill jobs on shell exit.
unsetopt CHECK_JOBS # Don't report on jobs when shell exit.
# https://github.com/sorin-ionescu/prezto/blob/master/modules/directory/init.zsh
setopt AUTO_CD # Auto changes to a directory without typing cd.
setopt AUTO_PUSHD # Push the old directory onto the stack on cd.
setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd.
setopt PUSHD_TO_HOME # Push to home directory when no argument is given.
setopt CDABLE_VARS # Change directory to a path stored in a variable.
setopt MULTIOS # Write to multiple descriptors.
setopt EXTENDED_GLOB # Use extended globbing syntax.
unsetopt CLOBBER # Do not overwrite existing files with > and >>.
# Use >! and >>! to bypass.
# others
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # case insensitive
# ============================================================================
# Added by Zinit's installer (30/6/2020)
# ============================================================================
if [[ ! -f $HOME/.config/zsh/.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/.config/zsh/.zinit" && command chmod g-rwX "$HOME/.config/zsh/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.config/zsh/.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/.config/zsh/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zinit-zsh/z-a-rust \
zinit-zsh/z-a-as-monitor \
zinit-zsh/z-a-patch-dl \
zinit-zsh/z-a-bin-gem-node
# ============================================================================
# Plugins
# ============================================================================
# load immediately
(( $+commands[starship] )) && eval "$(starship init zsh)"
zinit light agkozak/zsh-z
zinit snippet ${ZDOTDIR}/keybindings.zsh
zinit snippet ${ZDOTDIR}/secrets.zsh
# load in the background
zinit ice lucid wait'2' as"program" pick"$ZPFX/bin/git-*" src"etc/git-extras-completion.zsh" make"PREFIX=$ZPFX"
zinit light tj/git-extras
zinit wait lucid for \
is-snippet "${ZDOTDIR}/aliases.zsh" \
is-snippet "${ZDOTDIR}/autocomplete.zsh"
zinit wait lucid as'completion' is-snippet for \
'https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker'
zinit wait lucid light-mode for \
atinit"zicompinit; zicdreplay" \
zdharma/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
#=======================================================================
# Custom environment
# Since this is only loaded on login, source it after making any changes
#=======================================================================
path=(
$HOME/.local/bin
$HOME/dotfiles/bin
$HOME/.emacs.d/bin
/usr/local/opt/texinfo/bin
/usr/local/opt/openssl@1.1/bin
/Applications/Alacritty.app/Contents/MacOS
/Applications/Vivaldi.app/Contents/MacOS
$path
)
# export GOWORK="~/go/src/github.com/sagittaros"
# export GOPATH="/Users/felix/go"
export GPG_TTY=$(tty) # Sign git commit with gpg
# For compilers
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# hook up direnv (and nix)
eval "$(direnv hook zsh)"
export DIRENV_LOG_FORMAT=""
export PATH="$HOME/.poetry/bin:$PATH"
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/xi/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/xi/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/xi/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/xi/google-cloud-sdk/completion.zsh.inc'; fi