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