Add {for,back}ward-word-fine widgets and bindings

This commit is contained in:
Adam Goldsmith 2024-08-28 11:37:46 -04:00
parent 95d4a1dc47
commit 8ef873b00f

9
.zshrc
View File

@ -62,6 +62,15 @@ zstyle ':completion:*' matcher-list 'm:{[:lower:]-}={[:upper:]_} r:|[.]=**' '+l:
bindkey '^[[5~' history-substring-search-up
bindkey '^[[6~' history-substring-search-down
# fine word navigation
backward-word-fine() WORDCHARS='' zle .backward-word
forward-word-fine() WORDCHARS='' zle .forward-word
zle -N backward-word-fine
zle -N forward-word-fine
bindkey '^[F' forward-word-fine
bindkey '^[B' backward-word-fine
ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS+=(forward-word-fine backward-word-fine)
# equivalents of eponymous Emacs functions
# from https://unix.stackexchange.com/a/595157
delete-horizontal-space() {