-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
119 lines (105 loc) · 4.09 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
# Brag about my system when I open my terminal
# I'm gonna do something with this I promise
case $(ps -o comm= -p $PPID) in
'electron')
# Config for any Electron terminals, mainly for VSCode
fastfetch -c ~/.config/fastfetch/electron.jsonc
;;
'yakuake')
# Config for Yakuake
fastfetch -c ~/.config/fastfetch/yakuake.jsonc
;;
'kitty')
# Config for Kitty
fastfetch -c ~/.config/fastfetch/kitty.jsonc
;;
'nvim')
# Config for Neovim terminal
fastfetch -c ~/.config/fastfetch/nvim.jsonc
;;
'login')
# Config for YTT3 terminal
fastfetch -c ~/.config/fastfetch/ytt.jsonc
;;
*)
# Default config for everything else
fastfetch
;;
esac
# where plugins are stored
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
# Download Zinit, if it isnt
if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# Load zinit
source "${ZINIT_HOME}/zinit.zsh"
# Load Zinit Plugins
zinit ice depth=1; zinit light romkatv/powerlevel10k
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-completions
zinit light Aloxaf/fzf-tab
zinit light atuinsh/atuin
# Add in snippets
zinit snippet OMZP::git
zinit snippet OMZP::sudo
zinit snippet OMZP::archlinux
zinit snippet OMZP::aws
zinit snippet OMZP::kubectl
zinit snippet OMZP::kubectx
zinit snippet OMZP::command-not-found
# Load completions
autoload -Uz compinit && compinit
zinit cdreplay -q
# Powerlevel10k starting
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# The prompt config
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Keybinds
bindkey -e
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
# History
HISTFILE=~/.zsh_history
HISTSIZE=3000
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory # share history through all active zsh sessions
setopt hist_ignore_space # command won't be added to the history if you begin with a space
setopt hist_save_no_dups # prevents duplicate commands from entering the history
setopt hist_find_no_dups # prevents duplicate commands from showing in the historical search
setopt hist_ignore_dups # prevents duplicate commands from entering the history
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=hl:#61AFEF,hl+:#4DC4FF,info:#E5C07B,marker:#98C379
--color=prompt:#C678DD,spinner:#DE73FF,pointer:#DE73FF,header:#56B6C2
--color=border:#5c6370,scrollbar:#A5E075,label:#aeaeae,query:#ABB2BF
--border="rounded" --border-label="Double Quarter Pounder with Cheese" --border-label-pos="-8" --preview-window="border-bold"
--prompt="> " --marker=">" --pointer="◆" --separator=".. ..- ... . .- .-. -.-. .... -... - .-- "
--scrollbar="I" --layout="reverse"'
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# Integrations
eval "$(zoxide init --cmd cd zsh)" # change zoxide's command to 'cd' instead of 'z'
eval "$(thefuck --alias)" # so I can curse when I make a mistake
eval "$(atuin init zsh)" # enable atuin; a better history
eval "$(fzf --zsh)" # fuzzy finder keybinds or smth
export BAT_THEME="OneHalfDark" # sets the Bat theme to match Kitty
# Aliases
alias bye='shutdown now' # shuts down the system immediately
alias cat='bat' # muscle memory fix
alias fucking='sudo' # because funny
alias in='yay -S' # Installs (a) package(s) system and aur
alias ls='ls --color' # adds color to the ls command
alias lsa='ls -a --color' # makes it easier to use the ls -a command with color
alias un='yay -Rns' # uninstalls (a) package(s) and useless dependencies
alias up='yay -Syu' # update all packages system and aur
alias vim='nvim' # muscle memory fix
alias xcm='chmod +x' # shortens the command for adding execute perms for files
alias yeet-orphans='sudo pacman -Rs $(pacman -Qtdq)' # deletes orphan packages