moe icon indicating copy to clipboard operation
moe copied to clipboard

Searching and case sensitivity / should moe behave like vim?

Open tobimensch opened this issue 3 years ago • 3 comments

Moe's search is case sensitive now, just like vim's search is by default.

This isn't how some modern editors or commonly used search boxes behave though.

  • searches on the web are usually case insensitive
  • page searches like in web browsers and other applications are usually case insensitive
  • some editors have a case insensitive search by default, on my system that's true for gedit, deepin editor, codium, ..., I'm not going to investigate every single editor for their behavior, but to me it looks like the trend is to case insensitive or smartCase search by default

There's also something between case sensitive and insensitive, which is called smartCase, and basically there it is case insensitive as long as everything is written in small letters. So a search on abc is case insensitive, while aBc is case sensitive. This is probably what you want for 95% or more use cases.

The question is also if moe should imitate every single quirk of vim's tradition, or sometimes try to do something that's more user friendly and sensible than the original.

I'm sure there are some good arguments for case sensitivity by default being enabled, besides vim users being used to it. Which is also a good argument, breaking user habits is seldomly a great thing.

But still, with smartCase there's really only one case where a user would want case sensitivity and wouldn't get it, and that's went they want to match an all lower case word, with no upper case characters in it. For that a flag like /\s could be introduced, or maybe quotations /'lower'.

I don't know what's the best solution here, or if we should simply copy vim exactly.

tobimensch avatar Jul 10 '20 21:07 tobimensch

@tobimensch

I will add ignorecase and smartcase settings.

fox0430 avatar Jul 10 '20 21:07 fox0430

I, too, don't know what's the best solution. I think adding a setting to the configuration file is certainly a good way. In addition to this, I personally want a way to select case sensitive/case insensitive/smartCase on-the-fly when searching without changing the settings.

The question is also if moe should imitate every single quirk of vim's tradition, or sometimes try to do something that's more user friendly and sensible than the original.

I'm also curious about this and I think this is a good topic of discussion. IMO I want moe to try to do something that's more user friendly and sensible than the original.

walkre-niboshi avatar Jul 30 '20 23:07 walkre-niboshi

I'm also curious about this and I think this is a good topic of discussion. IMO I want moe to try to do something that's more user friendly and sensible than the original.

That's generally what I want, too. Especially the existence of distributions for vim such as SpaceVim (and many others like it) tell me that the defaults for Vim are more like a platform for building an editor, than a finished editor. And I'd like moe to feel more like a finished editor, that you can install and pretty much use, without needing to search for 50 plugins, and making hours of edits to a config file. For this to work moe needs very sensible defaults and the most often desired functionalities built in. QuickRun is a good example of this, where you need a plugin in vim, and you first need to know about that plugin, then you install it and configure it. Now we have (a still very basic) an implementation of QuickRun built into moe, which is very good in my opinion, because it prevents fragmentation (no reason to write competing plugins now), and you can expect all moe installations to come with that feature. Or to put it in a nutshell, vim is very different depending on which plugins someone has and which configuration, while with moe I would hope that you can expect to get the same features and many common functionalities on all moe installations.

tobimensch avatar Jul 30 '20 23:07 tobimensch