zsh: Generate text objects for quotes and brackets

This commit is contained in:
2025-09-07 05:29:17 +02:00
parent 59b2334253
commit a9163907be

View File

@@ -124,3 +124,17 @@ export _ZO_FZF_OPTS="--tmux"
if hash zoxide 2>/dev/null; then
eval "$(zoxide init zsh --cmd cd)"
fi
# Generate missing text objects
autoload -Uz select-bracketed select-quoted
zle -N select-quoted
zle -N select-bracketed
for km in viopp visual; do
bindkey -M $km -- '-' vi-up-line-or-history
for c in {a,i}${(s..)^:-\'\"\`\|,./:;=+@}; do
bindkey -M $km $c select-quoted
done
for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do
bindkey -M $km $c select-bracketed
done
done