i3swallow/i3swallow.plugin.zsh
Sebastian Mark 0b77fd3658 FIX: use non-colloding function name
fixes `read-only variable: LBUFFER`

see 535b0b8 of man.zshplugin
2018-07-13 11:30:56 +02:00

12 lines
316 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

i3swallow-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == i3-swallow\ * ]]; then
LBUFFER="${LBUFFER#i3-swallow }"
else
LBUFFER="i3-swallow $LBUFFER"
fi
}
zle -N i3swallow-command-line
# Defined shortcut keys: [Pos1][Pos1]
bindkey "OHOH" i3swallow-command-line