evil-helix icon indicating copy to clipboard operation
evil-helix copied to clipboard

Word search with `*` / `#` should support case-sensitive searching

Open usagi-flow opened this issue 7 months ago • 2 comments

This is a known issue of #79.

Currently, we always search case insensitively, by prefixing the search regex with (?i).

We should consider making this behavior configurable, e.g. depending on search.smart-case (which could be seen as the closest equivalent to Vim's :set [no]ignorecase, although I'm open to suggestions if someone has a better idea).

If we stick to the current implementation which prepares a regex, we can prefix it with (?-i) instead. This is not tested, but might work.

usagi-flow avatar Jun 01 '25 14:06 usagi-flow

I think this should be a feature request for [no]ignorecase.

There's a nice feature of Vim */# that you will always cycle back where you started. Quoting the docs:

Only whole keywords are searched for, like with the command "/<keyword>". |exclusive| 'ignorecase' is used, 'smartcase' is not.

So, Helix smart-case should be ignored. We need an ignorecase to match Vim.

badranX avatar Jun 01 '25 15:06 badranX

Good point. I admit I'm not happy with the idea of using search.smart-case for this, and reading your comment I realize that may even be a bit misleading towards Vim users.

But if we introduce something like search.ignore-case, we would have to adjust existing functionality as well, especially the default search.

usagi-flow avatar Jun 01 '25 18:06 usagi-flow