Turns out the "how" answer is very simple: In very-magic mode, % is already magical. Therefore, instead of \%u4e2d, %u4e2d (no backslash) works fine! In full, that's /\v%u4e2d<CR>


To answer my own question: 1) There is no internal function to get a character at a byte offset. 2) How is the performance of the script function? Surprisingly: Very good. I hacked Vim and added a new function called strcharatbyte(str, index) that returns the same list as the script function s:GetCharAtByteIdx in my question. Then I ran the tests for my ...


set timeoutlen=500 resolves this. Thanks Matt.


According to :h /\v: */\v* */\V* Use of "\v" means that after it, all ASCII characters except '0'-'9', 'a'-'z', 'A'-'Z' and '_' have special meaning: "very magic" It's ASCII characters, not any characters. According to :h /\: */\* */\\* \x A backslash followed by a single character, with no special ...

Only top voted, non community-wiki answers of a minimum length are eligible