Is there a way to instruct Vim that I want to ignore diacritics/accents when searching? For example, I would like to be able to search forkoikaby entering/kocickaThe ignorecase and smartcase options are very useful, but they do not seem to have anything to do with diacritics/accents.
Ignoring diacritics/accents when searching
search
As @muru mentioned in the comment, you could use an equivalence class (described in :help /[[) which seems to be a character class expression evaluated as a set of similar characters (i.e. are the same once you remove any accent/diacritic).For example, to look for koika and kocicka with the same pattern, you could use this:ko[[=c=]]i[[=c=]]kawhere [[=c=]] is the equivalence class for the c character.To automatically insert this character class whenever you hit c while performing a search, you could use this mapping:cnoremap <expr> c getcmdtype() =~ '[?/]' ? '[[=c=]]' : 'c'which can be broken down like this:<expr> type the evaluation of an expressiongetcmdtype() =~ '[?/]' test whether you're writing a backward or forward search'[[=c=]]' return the equivalence class for the c character if the previous test succeeded'c' return the c character otherwise The previous mapping has 2 drawbacks:  it only covers the c characterit can make the pattern difficult to readIt could be improved by remapping <CR> like this:cnoremap <CR> <C-\>e getcmdtype() =~ '[?/]' ? substitute(getcmdline(), '\a', '[[=\0=]]', 'g'): getcmdline()<CR><CR>When you hit <CR> after writing a pattern for a search, the mapping will automatically replace all the alphabetic characters by their equivalence class counterpart.  The mapping for <CR> is similar to the previous mapping for c, except it doesn't use the argument <expr> but the system mapping <C-\>e.<expr> allows you to insert the evaluation of an expression, while <C-\>e allows you to replace the whole command line with the evaluation of an expression.