-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
190 lines (152 loc) · 5.7 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
######################################################
# #
# Tyler Wray's .zshrc #
# #
######################################################
# IDK If I need this anymore
# export ZSH_DISABLE_COMPFIX="true"
# 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
include() {
[[ -f "$1" ]] && source "$1"
}
# Directories to be prepended to $PATH
declare -a dirs_to_prepend
dirs_to_prepend=(
"/bin"
"/sbin"
"/usr/sbin"
"/usr/bin"
"/usr/local/bin"
"/usr/local/sbin"
"/usr/local/git/bin"
"/usr/local/"
"/usr/local/mysql/bin"
"/sw/bin/"
"$HOME/dotfiles/bin"
"$HOME/bin"
"$HOME/Library/Python/2.7/bin"
"$HOME/go/bin"
"/usr/local/opt/icu4c/bin"
"/usr/local/opt/icu4c/sbin"
"$HOME/.cargo/bin"
"$HOME/.yarn/bin"
"$HOME/.config/yarn/global/node_modules/.bin"
"/opt/homebrew/bin"
)
# Loop and assign path above
for dir in ${(k)dirs_to_prepend[@]}
do
if [ -d ${dir} ]; then
# If these directories exist, then prepend them to existing PATH
PATH="${dir}:$PATH"
fi
done
unset dirs_to_prepend
export PATH
# Hide the agnoster prefix user on local machine
DEFAULT_USER='tylerwray'
prompt_context(){}
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# ZSH_THEME="agnoster"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(asdf git)
include $ZSH/oh-my-zsh.sh
include ~/.localrc
# ----------- Aliases --------------
# Shortcuts
alias l="ls"
alias g="git"
alias e="nvim +Files"
# Elixir
alias phx="iex -S mix phx.server"
# Git Stuff
alias gs='git status'
alias gl='git log'
alias gb='git branch | cat'
alias gsl='git shortlog -sn'
alias gwts='git ls-files | xargs wc -l' # count number of lines of code in a git project
alias lumberjack="git fetch -p > /dev/null 2>&1 && git branch --no-color -vv | grep 'origin/.*: gone]' | awk '{print \$1}' | xargs git branch -D"
alias wip="git add . && git commit -m \"WIP\" --no-verify"
alias unwip="git reset HEAD~"
export GIT_MERGE_AUTOEDIT=no # Don't open merge message edit when merging master
# File size
alias fs="stat -f \"%z bytes\""
# ZSH
alias reload="source ~/.zshrc && echo 'Shell config reloaded from ~/.zshrc'"
alias zshrc="nvim ~/dotfiles/zshrc"
alias localrc="nvim ~/.localrc"
# neovim
alias nvc="(cd ~/.config/nvim && nvim .)"
# tmux
alias tmc="(cd ~/.config/tmux && nvim .)"
# ---------- Environment ----------
# terminal
export TERM=xterm-256color
# ssh
export SSH_KEY_PATH="~/.ssh/id_rsa"
# bat
export BAT_THEME="Catppuccin-macchiato"
export BAT_STYLE="numbers,changes"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# fzf
export FZF_DEFAULT_COMMAND="rg --files --hidden --iglob '!.git'"
FZF_DEFAULT_OPTS="--border --preview '[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --color=always --pager=\"less -FR\" {} || cat {}) 2> /dev/null | head -500'"
# Onedark theme
# export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
# --color=dark
# --color=fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:-1,hl+:#d858fe
# --color=info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef
# '
# Catppuccin-Macchiato Theme
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS" \
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"
# Dracula Theme
# export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
# --color=dark
# --color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
# --color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7
# '
# Gruvbox theme
# export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
# --color=fg:#ebdbb2,bg:#282828,hl:#689d6a
# --color=fg+:#fbf1c7,bg+:#282828,hl+:#8ec07c
# --color=info:#458588,prompt:#83a598,pointer:#fb4934
# --color=marker:#fabd2f,spinner:#83a598,header:#83a598
# '
# Sonokai Theme
# export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
# --color=fg:#afafb5,bg:#2c2e34,hl:#90ba6c
# --color=fg+:#e2e2e3,bg+:#2c2e34,hl+:#a7df78
# --color=info:#e7c664,prompt:#fc5d7c,pointer:#b39df3
# --color=marker:#f39660,spinner:#b39df3,header:#76cce0'
include ~/.fzf.zsh
export ERL_AFLAGS="-kernel shell_history enabled"
fpath=(~/.stripe $fpath)
autoload -Uz compinit && compinit -i
export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
export ERL_AFLAGS="-kernel shell_history enabled"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Load rbenv
eval "$(rbenv init - zsh)"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh