some minor tweaks

This commit is contained in:
pik4li 2024-12-23 23:00:17 +01:00
parent d84e4f5a7a
commit 2ef1ba0f33

36
.zshrc
View file

@ -84,14 +84,21 @@ autoload -Uz compinit && compinit
bindkey -e bindkey -e
# Use Alt + Backspace to delete the previous word # # Define custom word style that treats special characters as word boundaries
bindkey '^[^?' backward-kill-word # autoload -U select-word-style
# select-word-style fish
# Use Alt + Left Arrow to move to the previous word # # Use Alt + Backspace to delete the previous word
bindkey '^[[1;3D' backward-word # bindkey '^[^?' backward-kill-word
# Use Alt + Right Arrow to move to the next word # # Use Alt + Left Arrow to move to the previous word
bindkey '^[[1;3C' forward-word # bindkey '^[[1;3D' backward-word
# # Use Alt + Right Arrow to move to the next word
# bindkey '^[[1;3C' forward-word
# # Define additional word characters to split on, excluding '/'
# WORDCHARS='*?_.[]~=&;!#$%^(){}<>'
setopt appendhistory setopt appendhistory
setopt sharehistory setopt sharehistory
@ -110,7 +117,7 @@ HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE SAVEHIST=$HISTSIZE
HISTDUP=erase HISTDUP=erase
# Completion styling # Completion styling
zstyle :compinstall filename '/home/pika/.zshrc' zstyle :compinstall filename "$HOME/.zshrc"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no zstyle ':completion:*' menu no
@ -133,6 +140,7 @@ _init (){
else else
curl -s https://ohmyposh.dev/install.sh | sudo bash --norc -s -- -d /usr/bin/ curl -s https://ohmyposh.dev/install.sh | sudo bash --norc -s -- -d /usr/bin/
fi fi
if command_exists zoxide; then if command_exists zoxide; then
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
eval "$(zoxide init zsh --cmd cd)" eval "$(zoxide init zsh --cmd cd)"
@ -177,7 +185,6 @@ DEBUG_PLUG=""
_alias(){ _alias(){
alias please="sudo" alias please="sudo"
alias untar="tar -xf"
# ─< easier dir up >──────────────────────────────────────────────────────────────────────── # ─< easier dir up >────────────────────────────────────────────────────────────────────────
alias ..="cd .." alias ..="cd .."
@ -243,8 +250,8 @@ _alias(){
# ─< t stands for tmux >──────────────────────────────────────────────────────────────────── # ─< t stands for tmux >────────────────────────────────────────────────────────────────────
if command_exists tmux; then if command_exists tmux; then
local tmux_y="-- tmux-session active! | connecting to active session --" local tmux_y="$(echo '-- tmux-session active! | connecting to active session --')"
local tmux_n="-- no tmux-session found! | creating one --" local tmux_n="$(echo '-- no tmux-session found! | creating one --')"
ta() { ta() {
command tmux list-sessions >/dev/null 2>&1 command tmux list-sessions >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -324,8 +331,6 @@ _alias(){
git clone https://git.k4li.de/mirrors/fastfetch.git "$HOME/.local/share/fastfetch" >/dev/null 2>&1 git clone https://git.k4li.de/mirrors/fastfetch.git "$HOME/.local/share/fastfetch" >/dev/null 2>&1
exec "$SHELL" exec "$SHELL"
fi fi
command clear &
fastfetch
fi fi
# ─< d stands for docker >────────────────────────────────────────────────────────────────── # ─< d stands for docker >──────────────────────────────────────────────────────────────────
@ -442,7 +447,7 @@ _coding_() {
# ─< h stands for HUGO >────────────────────────────────────────────────────────────────── # ─< h stands for HUGO >──────────────────────────────────────────────────────────────────
if command_exists hugo; then if command_exists hugo; then
alias h='hugo' alias h='hugo'
alias hs='hugo server -D --noHTTPCache --disableFastRender' # --bind "$(get_ip)"' alias hs='hugo server -D --noHTTPCache --disableFastRender --bind "$(get_ip)"'
fi fi
# ─< c stands for bin/cake >────────────────────────────────────────────────────────────── # ─< c stands for bin/cake >──────────────────────────────────────────────────────────────
# alias cake='bin/cake' # alias cake='bin/cake'
@ -556,9 +561,9 @@ get_packager() {
;; ;;
# RHEL-based # RHEL-based
fedora|centos|nobara) fedora|centos)
alias search="dnf search" alias search="dnf search"
alias install="$_sudo dnf install" alias install="$_sudo dnf install --yes"
alias update="$_sudo dnf update" alias update="$_sudo dnf update"
alias remove="$_sudo dnf remove" alias remove="$_sudo dnf remove"
;; ;;
@ -627,6 +632,7 @@ _end(){
fi fi
if command_exists cowsay; then if command_exists cowsay; then
alias clear='clear && cowsay -f tux "$(uptime --pretty)"'
cowsay -f tux "$(uptime --pretty)" cowsay -f tux "$(uptime --pretty)"
fi fi