Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug: zsh vim textobjects and slash



Itay Shakury wrote:
> Example: if I'm typing `ls /var/lib/docker` and want to change 'lib' to
> 'run', I would place the cursor in the 'lib' word, and do `ciw`. In vim
> this would delete the 'lib' word and put me in insert mode. In zsh it
> deletes the entire path ('var/lib/docker').

This bug doesn't occur with a default zsh setup. I do, however, have
a theory as to the cause. I suspect that you are using a plugin that
redefines every zle widget (every key in effect).
zsh-syntax-highlighting perhaps?

If you do "bindkey -M viopp iw", you should see:
  "iw" select-in-word
And if you do "zle -lL select-in-word", you should get nothing. If you
do get something, it is likely that select-in-word has been redefined.

The trouble is that internally, one function handles all of iw, iW, aw
and aW. It is checking whether the invoked widget is select-in-word. But
if you've redefined that, the check returns false and you get iW
(select-in-blank-word) behaviour.

I think this has been fixed in a6135f6 (41191) which is in zsh 5.4.

I'm not quite sure of how to remove the custom select-in-word widget
other than by disabling the entire plugin. zle -D select-in-word seems
to cause other problems. If I run that after sourcing
zsh-syntax-highlighting, I can get a seg fault, including with 5.5.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author