0

When I use standard zsh ctrl+w deletes whole word (i.e. it would remove whole foo-bar). However, when using oh-my-zsh I would delete only last part of the word and leave foo-. I want to be able to use both.

I want to bind ctrl+q to delete whole word. I've tried to define my own function with WORDCHARS overridden but with no luck:

myf () {
  local WORDCHARS=''
  zle backward-kill-word
}
zle -N myf
bindkey '^Q' myf

There are couple of similar questions but this one is when using zsh with oh-my-zsh.

lukaszb
  • 101
  • 1
  • A related answer is of course https://unix.stackexchange.com/a/250700/5132 . – JdeBP Dec 30 '19 at 13:00
  • I just tried a clean install with oh-my-zsh and your code above and it works fine for me. Are you sure you don't have something else sourced that is messing things up? – Marlon Richert Jun 18 '20 at 11:25

0 Answers0