1

I've been using zsh with oh-my-zsh for nearly three years, mostly on debian systems.
I'm using ctrlw and ctrly a lot. For three weeks now my workstation is a MacBook and I've been using zsh and oh-my-zsh on it too. But there's a awkward behavior.

When I cut multiple words backwards using ctrlw and try to yank the cut words with ctrly, only the last cut word is pasted. As far as I know it, ctrly yanks all the last cut words.

Can anybody tell me, which parameter is responsible for that?

Edit: '^W' is bound to backward-kill-word. Shouldn't it be backward-delete-word?

Edit 2: Ok, I've found out that zsh-autosuggestions is responsible for this. After disabling this ctrl^w and ctrl^y are working like expected. I think, I have to dig into zsh-autosuggestions configuration to get to the parameter changing the behaviour.

Edit 3: When zsh-autosuggestions is enabled zle -lLa backward-kill-word returns this

zle -N backward-kill-word _zsh_autosuggest_bound_1_backward-kill-word

and which _zsh_autosuggest_bound_1_backward-kill-word returns

_zsh_autosuggest_bound_1_backward-kill-word () {
_zsh_autosuggest_widget_modify autosuggest-orig-1-backward-kill-word $@}

I'm not very into deep in the zsh, so I don't know exactly what this means. But my guess is, that zsh-autosuggestions kind of "overrides" the default functionality of backward-kill-word, right?

  • Most probably, you or one of the oh-my-zsh modules you've enabled remaps the word cutting widgets to some that don't preserve that property. What is ^W bound to? What's the output of bindkey '^W'? And zle -lLa thewidget for the widget mentioned in the output of bindkey, and which thefunction for the function that widget uses if any. – Stéphane Chazelas Feb 26 '18 at 11:32
  • backward-delete-word is the default widget (see zsh -f for the default behaviour). But the question is, has the widget been redefined. Does zle -lLa backward-kill-word return something? If yes, can you run which on the last word in the line it reports. Please add the information to your question by clicking on the edit link – Stéphane Chazelas Feb 26 '18 at 12:35
1

Ok, I've found out that zsh-autosuggestions is responsible for this. After disabling this ctrl^w and ctrl^y are working like expected. I think, I have to dig into zsh-autosuggestions configuration to get to the parameter changing the behaviour.

| improve this answer | |
  • More likely that extension doesn't support preserving that. You could raise a bug report about it. See the manual about zle -f kill in recent versions of zsh and see how other extensions like backward-kill-word-match do it. – Stéphane Chazelas Mar 5 '18 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.