I wondered how to do a case insensitive search with /. I found out without much trouble that it could be done by using a regex like (?i)something.
I haven't seen it in the perl regex syntax link provided in kakoune documentation (my poor of ability to read the doc?). I thought it might be worth documenting it more explicitly, given it's a relatively common need.
Here is the relevant bit from the documentation:
Modifiers
(?imsx-imsx ... ) alters which of the perl modifiers are in effect within the pattern, changes take effect from the point that the block is first seen and extend to any enclosing ). Letters before a '-' turn that perl modifier on, letters afterward, turn it off.
(?imsx-imsx:pattern) applies the specified modifiers to pattern only.
I have the following bindings in my configuration:
map -docstring 'case insensitive search' global user '/' /(?i)
map -docstring 'case insensitive backward search' global user '<a-/>' <a-/>(?i)
map -docstring 'case insensitive extend search' global user '?' ?(?i)
map -docstring 'case insensitive backward extend-search' global user '<a-?>' <a-?>(?i)
Maybe this could be written in the wiki or something.
Yep, case insensitive search is done by adding (?i) in the regex, and can be automated as shown by @lenormf.
Most helpful comment
Here is the relevant bit from the documentation:
I have the following bindings in my configuration:
Maybe this could be written in the wiki or something.