-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
98 lines (76 loc) · 2.81 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
# Export TTY for signing git commits
# Needs to be at the top since for P11k instant promptstdin is redirected from /dev/null
# GPG_TTY=$(tty)
# export GPG_TTY
# Better option since this works even if stdin is redirected
export GPG_TTY=$TTY
# 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
# Load sapceship customizations before the theme
# Not recommended, but customizations would only work on $(eval zsh)
# source "$HOME/cfg/spaceshiprc.zsh"
# Load Antigen
source "$HOME/antigen.zsh"
# Load Antigen configurations
antigen init ~/cfg/antigenrc
# function to source if the file exists and is readable
source_if_exists() {
[[ -r "$1" ]] && source "$1"
}
# Load Aliases
source_if_exists "$HOME/cfg/aliases.sh"
# Load Functions
source_if_exists "$HOME/cfg/functions.sh"
# To customize prompt, run `p10k configure` or edit ~/cfg/.p10k.zsh.
# Load P10K
# source_if_exists "$HOME/cfg/.p10k.zsh"
# Load Fzf
source_if_exists "$HOME/cfg/fzf.zsh"
# Load Exports
source_if_exists "$HOME/cfg/exports.sh"
# # Load ZSH Dracula theme variables
# source_if_exists "$HOME/cfg/dracula.sh"
# ZSH Spaceship prompt config file
export SPACESHIP_CONFIG="$HOME/cfg/spaceshiprc.zsh"
# Load nvm
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Why was the dot escaped
source_if_exists "$NVM_DIR/nvm.sh"
# TODO: Update source_if_exists for multiple entires
# Source NVM zsh integration
if [[ -d "$NVM_DIR" && -f ~/cfg/nvmrc ]]; then
. ~/cfg/nvmrc
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi
# Source cargo
source_if_exists "$HOME/.cargo/env"
# Activate pyenv
# if command -v pyenv >/dev/null; then
# eval "$(pyenv init -)"
# fi
# Load rbenv shell integration
if [[ -d "$HOME/.rbenv" && -f ~/cfg/rbenvrc ]]; then
. ~/cfg/rbenvrc
fi
# Source any local configs/ Tokens
source_if_exists "$HOME/cfg/extras.local"
# dotfiles aliases
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME'
dot() {
if [[ "$#" -eq 0 ]]; then
(
cd /
for i in $(dotfiles ls-files); do
echo -n "$(dotfiles -c color.status=always status "$i" -s | sed "s#$i##")"
echo -e "¬/$i¬\e[0;33m$(dotfiles -c color.ui=always log -1 --format="%s" -- "$i")\e[0m"
done
) | column -t --separator=¬ -T2
else
/usr/bin/git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME "$@"
fi
}
export STARSHIP_CONFIG="$HOME/cfg/starship.toml"
eval "$(starship init zsh)"