This commit is contained in:
Sebastian Mark 2018-05-12 00:00:33 +02:00
commit 73fa9df70e
2 changed files with 17 additions and 0 deletions

5
README.md Normal file
View file

@ -0,0 +1,5 @@
# i3-swallow zsh plugin
prefixes a command with `i3-swallow` by pressing <kbd>Pos1</kbd> twice
requires [i3-swallows](https://github.com/jamesofarrell/i3-swallow)

12
i3swallow.plugin.zsh Normal file
View file

@ -0,0 +1,12 @@
_i3swallow() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == i3-swallow\ * ]]; then
LBUFFER="${LBUFFER#sudo }"
else
LBUFFER="i3-swallow $LBUFFER"
fi
}
zle -N _i3swallow
# Defined shortcut keys: [Pos1][Pos1]
bindkey "OHOH" _i3swallow