-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
141 lines (121 loc) · 4.47 KB
/
Copy path.zshrc
File metadata and controls
141 lines (121 loc) · 4.47 KB
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
# __
# ____ _____/ /_ __________
# /_ / / ___/ __ \/ ___/ ___/
# / /_(__ ) / / / / / /__
# /___/____/_/ /_/_/ \___/
#
# AUTHOR = MHD
# Starts Starship
export STARSHIP_CONFIG="$HOME/.config/wayland/zsh/starship.toml"
eval "$(starship init zsh)"
# Vars
export VISUAL="${EDITOR}"
export EDITOR="nvim"
export SUDO_EDITOR="$EDITOR"
export BROWSER='firefox'
export HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)"
export SUDO_PROMPT="Password : "
export BAT_THEME="base16"
export QT_QPA_PLATFORM=wayland
# fcitx vars
export GTK_IM_MODULE='fcitx'
export QT_IM_MODULE='fcitx'
export SDL_IM_MODULE='fcitx'
export XMODIFIERS='@im=fcitx'
if [ -d "$HOME/.local/bin" ] ;
then PATH="$HOME/.local/bin:$PATH"
fi
# Create ZSH config directory if it doesn't exist
[[ ! -d ~/.config/wayland/zsh ]] && mkdir -p ~/.config/wayland/zsh
# Waiting dots animation
expand-or-complete-with-dots() {
echo -n "\e[31m…\e[0m"
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
# History configuration
HISTFILE=~/.config/wayland/zsh/.histfile
HISTSIZE=10000
SAVEHIST=50000
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
setopt inc_append_history
# zsh options
setopt beep
setopt PROMPT_SUBST # enable command substitution in prompt
setopt MENU_COMPLETE # Automatically highlight first element of completion menu
setopt LIST_PACKED # The completion menu takes less space.
setopt AUTO_LIST # Automatically list choices on ambiguous completion.
setopt COMPLETE_IN_WORD # Complete from both ends of a word.
bindkey -v
# Compinit Engine
autoload -Uz compinit
for dump in ~/.config/wayland/zsh/zcompdump(N.mh+24); do
compinit -d ~/.config/wayland/zsh/zcompdump
done
compinit -C -d ~/.config/wayland/zsh/zcompdump
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
precmd () { vcs_info }
_comp_options+=(globdots)
zstyle ':completion:*' verbose true
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 'ma=48;5;197;1'
zstyle ':completion:*' matcher-list \
'm:{a-zA-Z}={A-Za-z}' \
'+r:|[._-]=* r:|=*' \
'+l:|=*'
zstyle ':completion:*:warnings' format "%B%F{red}No matches for:%f %F{magenta}%d%b"
zstyle ':completion:*:descriptions' format '%F{yellow}[-- %d --]%f'
zstyle ':vcs_info:*' formats ' %B%s-[%F{magenta}%f %F{yellow}%b%f]-'
# Plugins
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
# Changes the terminal titles based on users location
function xterm_title_precmd () {
print -Pn -- '\e]2;%n@%m %~\a'
[[ "$TERM" == 'screen'* ]] && print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-}\e\\'
}
function xterm_title_preexec () {
print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"
[[ "$TERM" == 'screen'* ]] && { print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-} %# ' && print -n -- "${(q)1}\e\\"; }
}
if [[ "$TERM" == (kitty*|tmux*|screen*|xterm*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
add-zsh-hook -Uz preexec xterm_title_preexec
fi
# Wrong input message
command_not_found_handler() {
echo " \n 😮 Huh!! \n"
return 127
}
# ___ ___
# / | / (_)___ ______
# / /| | / / / __ `/ ___/
# / ___ |/ / / /_/ (__ )
# /_/ |_/_/_/\__,_/____/
alias grub-update="sudo grub-mkconfig -o /boot/grub/grub.cfg"
alias cat="bat --theme=base16"
alias ls='eza --icons=always --color=always -a -s type'
alias vi='nvim'
alias fastfetch='fastfetch -c ~/.config/wayland/fastfetch/config.jsonc'
alias 3dfetch='~/.config/wayland/fastfetch/3dfetch/fetch --shading-chars ▒▓█ --infinite --no-info'
alias tmux='tmux -f ~/.config/wayland/tmux/tmux.conf'
alias reflector='sudo reflector --protocol https --latest 5 --sort rate --country Japan --save /etc/pacman.d/mirrorlist'
alias todo="~/.config/wayland/scripts/todo"
alias icat='kitten icat'
alias comica='python ~/.config/wayland/scripts/comica'
# ___ __ _____ __ __
# / | __ __/ /_____ / ___// /_____ ______/ /_
# / /| |/ / / / __/ __ \\__ \/ __/ __ `/ ___/ __/
# / ___ / /_/ / /_/ /_/ /__/ / /_/ /_/ / / / /_
# /_/ |_\__,_/\__/\____/____/\__/\__,_/_/ \__/