-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
189 lines (147 loc) · 5.64 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# 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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
HIST_STAMPS="mm/dd/yyyy"
HISTFILE=~/.zsh_history
HISTSIZE=5000
SAVEHIST=5000
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
# User configuration
export PATH="/bin:/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/games:/usr/sbin:/home/james/scripts"
export EDITOR="nvim"
setopt AUTO_CD
setopt AUTO_PUSHD
setopt EXTENDED_GLOB
setopt PUSHD_SILENT
setopt PUSHD_TO_HOME
setopt COMPLETE_IN_WORD
setopt ZLE
unsetopt EQUALS
unsetopt correct_all
unsetopt correct
bindkey '^[[Z' reverse-menu-complete
ZSH_THEME="powerlevel10k/powerlevel10k" # Theme to be used
COMPLETION_WAITING_DOTS="true" # Display red dots whilst waiting for completion
DISABLE_UNTRACKED_FILES_DIRTY="true" # Mark untracked files under VCS as dirty
plugins=(git zsh-syntax-highlighting tmux notify) # Plugins
# User configuration {{{
# Aliases {{{
# import aliases from bash
if [[ -e $HOME/.bash_aliases ]]; then
. $HOME/.bash_aliases
fi
# import zsh-specific aliases
if [[ -e $HOME/.zsh_aliases ]]; then
. $HOME/.zsh_aliases
fi
# }}}
# Import colorscheme from 'wal' asynchronously
# & # Run the process in the background.
# ( ) # Hide shell job control messages.
(cat ~/.cache/wal/sequences &)
# Alternative (blocks terminal for 0-3ms)
cat ~/.cache/wal/sequences
# To add support for TTYs this line can be optionally added.
source ~/.cache/wal/colors-tty.sh
# }}}
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Uncomment to change how often before auto-updates occur? (in days)
export UPDATE_ZSH_DAYS=2
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias zshreload="source ~/.zshrc"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # FZF
export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden --ignore-file ~/.gitignore_global -g "!{node_modules,.git,.cache}" --follow'
# use cache when auto-completing
zstyle ':completion::complete:*' use-cache 1
# use case-insensitive auto-completing
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# graphical auto-complete menu
zstyle ':completion:*' menu select
# alert after command runs for longer than 5 seconds
zstyle ':notify:*' command-complete-timeout 5
# Use the time elapsed even when the command fails
zstyle ':notify:*' always-notify-on-failure no
# use automatic path prediction
# $predict-on to turn on and $predict-off to turn off
# autoload predict-off
# use advanced completion system
# autoload -U compinit && compinit
# colors
# autoload -U colors && colors
# Set xterm because of urxvt backspace bugs
export TERM="xterm-256color"
export REALTERM="rxvt-unicode-256color"
# Override colors
ZSH_HIGHLIGHT_STYLES[builtin]="fg=green,bold"
ZSH_HIGHLIGHT_STYLES[function]="fg=green,bold"
ZSH_HIGHLIGHT_STYLES[command]="fg=green,bold"
# Tmux
export ZSH_TMUX_AUTOSTART="false"
export ZSH_TMUX_AUTOCONNECT="true"
. /etc/zsh_command_not_found # Bash-like command not found
export GOPATH="$HOME/Dev/go"
export PATH="$HOME/Dev/tools/google_appengine:$PATH"
export PATH="$PATH:/usr/local/go/bin"
export PATH="$PATH:$GOPATH/bin"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="/snap/bin:$PATH"
export SPICETIFY_INSTALL="/home/james/spicetify-cli"
export PATH="$SPICETIFY_INSTALL:$PATH"
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/library"
# Pretend that we are using Unity (for the settings)
export XDG_CURRENT_DESKTOP=Unity
export XDG_CONFIG_HOME="$HOME/.config"
# Virtualenv wrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Dev
if [ -x "$(command -v foo)" ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
fi
if [ -f ~/.local/bin/virtualenvwrapper.sh ]; then
export VIRTUALENVWRAPPER_SCRIPT=~/.local/bin/virtualenvwrapper.sh
fi
if [ -f ~/.local/bin/virtualenvwrapper_lazy.sh ]; then
source ~/.local/bin/virtualenvwrapper_lazy.sh
fi
# # The next line updates PATH for the Google Cloud SDK.
if [ -f /home/james/Dev/tools/google-cloud-sdk/path.zsh.inc ]; then
source '/home/james/Dev/tools/google-cloud-sdk/path.zsh.inc'
fi
# The next line enables shell command completion for gcloud.
if [ -f /home/james/Dev/tools/google-cloud-sdk/completion.zsh.inc ]; then
source '/home/james/Dev/tools/google-cloud-sdk/completion.zsh.inc'
fi
# added by travis gem
[ -f /home/james/.travis/travis.sh ] && source /home/james/.travis/travis.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm