-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
92 lines (76 loc) · 2.39 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
# ====================================
# ========[INSTALLATION BLOCK]========
# ====================================
# Dependencies install
if [ ! -f "${ZDOTDIR:-$HOME}/.dotfiles-setup-complete" ]; then
read -r "?[.zshrc] Hi! It appears to be a fresh install. Do you want to let us install the dependencies?
[.zshrc] Note: Only Debian-based distros with APT are supported.
[.zshrc] Y - Yes, N or Enter - Not now, D - Don't ask me again.
[.zshrc] >>> " response
case "${response}" in
[yY]*)
echo "[.zshrc] Installing dependencies..."
sudo apt install python3 python-is-python3 neovim zoxide
touch "${ZDOTDIR:-$HOME}/.dotfiles-setup-complete"
;;
[nN]*)
;;
[dD]*)
touch "${ZDOTDIR:-$HOME}/.dotfiles-setup-complete"
;;
esac
fi
# Antidote install
if [ ! -d "${ZDOTDIR:-$HOME}/.antidote" ]; then
echo "[.zshrc] Getting Antidote..."
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote
fi
# =====================================
# ========[CONFIGURATION BLOCK]========
# =====================================
# Powerlevel10k
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
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Antidote init
zstyle ':antidote:bundle' use-friendly-names 'yes'
source ${ZDOTDIR:-$HOME}/.antidote/antidote.zsh
antidote load ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
# Colored ls
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# History
setopt SHARE_HISTORY
HISTFILE=$HOME/.zhistory
SAVEHIST=1000
HISTSIZE=999
setopt HIST_EXPIRE_DUPS_FIRST
setopt NO_BEEP
export HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
# GPG fix
export GPG_TTY=$(tty)
# Editor
export EDITOR=nvim
export VISUAL="$EDITOR"
# Zoxide
export PATH=${ZDOTDIR:-$HOME}/.local/bin:$PATH
eval "$(zoxide init zsh --cmd cd)"
# Aliases
source ${ZDOTDIR:-$HOME}/.zsh_aliases
# Keybinds
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
# Cargo / UV
. "$HOME/.cargo/env"
source ~/secrets.zsh
. "/root/.acme.sh/acme.sh.env"
# Addons
source ~/.zsh_addons/headscale.zsh