soheilpro / zsh-vi-search

Adds support for searching the current line (in normal vi mode) to zsh.
MIT License
13 stars 2 forks source link

Visual Mode Search #5

Open bmdahmen opened 2 years ago

bmdahmen commented 2 years ago

Firstly, this plugin is awesome, thanks a bunch for putting this out here.

It'd be awesome if the visual mode selection searching worked as well. So with the current setup when I enter visual mode in vi-mode zsh and try to search, I expect when it finds a pattern to select everything from where the cursor was to where the pattern was found. Instead visual mode is effectively exited prior to instantiating the search, and I end up with nothing selected after the search.

Is there an easy way around this?

qleveque commented 1 year ago

I also found myself facing this problem so I decided to dig further. In the end you just have to call zle set-mark-command after the read-from-minibuffer call in case you are in visual mode. Hope this still helps