zsh: enhance configuration with alacritty

This commit is contained in:
Clément Désiles
2026-05-05 22:58:56 +02:00
parent 4ac40b9898
commit 48e87f7cb1
5 changed files with 151 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
# {{ ansible_managed }}
# Essential environment variables - loaded before .zshrc for all sessions
# XDG Base Directory
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
# Enable color support
export CLICOLOR=1
export COLORTERM=truecolor
# Less configuration
export LESS=-R
export LESS_TERMCAP_mb=$'\E[1;31m'
export LESS_TERMCAP_md=$'\E[1;36m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[1;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[1;32m'
# Editors
export EDITOR=vim
export VISUAL=vim
# Locale
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
+22
View File
@@ -20,6 +20,9 @@ setopt PUSHD_IGNORE_DUPS # don't push duplicates
setopt CORRECT # correct command spelling
setopt NO_BEEP # no beeps
# Force emacs keybindings (zsh defaults to vi when EDITOR=vim)
bindkey -e
# Completion
autoload -Uz compinit
compinit -C # faster completion (cache)
@@ -35,6 +38,19 @@ source $ZSH_PLUGINS/powerlevel10k/powerlevel10k.zsh-theme
# Load powerlevel10k configuration
source {{ zsh_p10k_theme_config }}
# Exclude forward-word from partial-accept so that Opt+Right always navigates
# instead of accepting the next word from the autosuggestion.
# Right arrow (forward-char) still accepts the full suggestion.
ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=(
emacs-forward-word
vi-forward-word
vi-forward-word-end
vi-forward-blank-word
vi-forward-blank-word-end
vi-find-next-char
vi-find-next-char-skip
)
# Enable autosuggestions (before syntax highlighting)
source $ZSH_PLUGINS/zsh-autosuggestions/zsh-autosuggestions.zsh
@@ -62,3 +78,9 @@ export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
# Useful keybindings
bindkey "^[[A" history-substring-search-up
bindkey "^[[B" history-substring-search-down
# Line and word navigation (Alacritty Cmd/Opt+arrow compatibility)
bindkey '\eOH' beginning-of-line # Home / Cmd+Left
bindkey '\eOF' end-of-line # End / Cmd+Right
bindkey '\eb' backward-word # Opt+Left
bindkey '\ef' forward-word # Opt+Right