Skip to content

Instantly share code, notes, and snippets.

@paranormal
Created January 9, 2017 06:02
Show Gist options
  • Save paranormal/123ae082fe141c237ba0313e993dc247 to your computer and use it in GitHub Desktop.
Save paranormal/123ae082fe141c237ba0313e993dc247 to your computer and use it in GitHub Desktop.
function zle-keymap-select() {
zle reset-prompt
zle -R
if [ $TERM = "screen" ]; then
if [ $KEYMAP = vicmd ]; then
echo -ne '\033P\033]12;#FF3333\007\033\\'
else
echo -ne '\033P\033]12;#99FF33\007\033\\'
fi
elif [ $TERM != "linux" ]; then
if [ $KEYMAP = vicmd ]; then
echo -ne "\033]12;#FF3333\007"
else
echo -ne "\033]12;#00FF00\007"
fi
fi
}; zle -N zle-keymap-select
zle-line-init () {
zle -K viins
if [ $TERM = "screen" ]; then
echo -ne '\033P\033]12;#99FF33\007\033\\'
elif [ $TERM != "linux" ]; then
echo -ne "\033]12;#00FF00\007"
fi
}; zle -N zle-line-init
bindkey -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment