Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
usagi-flow opened this issue Jun 1, 2025 · 2 comments
Open

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

usagi-flow opened this issue Jun 1, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@usagi-flow
Copy link
Owner

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 usagi-flow added the bug Something isn't working label Jun 1, 2025
@badranX
Copy link
Contributor

badranX commented Jun 1, 2025

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.

@usagi-flow
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants