I have a file with the character (lowercase a + combining tilde). Encoding and fileencoding are both utf-8. ga shows

<a> 97, hex 61, octal 141 <~> 771, Hex 0303, Octal 1403

(but with the actual combining tilde in the <>) and g8 shows

61 + cc 83

Searching with /a\%u0303 works fine.

Searching for just \%u0303 gives E486 Pattern not Found.

Can I search for just the combining character without also searching for the base character?

  • 1
    Try this: /<ctr-v>u0303 type in normal mode / - start search <Ctr-u>v - init utf-8 code input 0303 - hexonal code combine character. Works fine for me.
    – Alex Kroll
    Jun 9 '15 at 15:21
  • 1
    Works great - thanks! :g/<Ctrl-V>u0303 also worked from the command line. Please add as an answer so I can accept it. Much appreciated! (Vim docs at vimhelp.appspot.com/insert.txt.html#i_CTRL-V_digit )
    – cxw
    Jun 9 '15 at 16:06

Type in normal mode /<ctr-v>u0303
/ - start search
<Ctr-v>u - init utf-8 code input
0303 - hex code combine character.

:he unicode

Also :he mbyte-combining and :he utf-8-char-arg the last one covered case with commands like f, F and so on.

  • Interestingly, this only works if the character is combined with something. If a file or line begins with the 0303 character, it won't be found by this method.
    – Bladt
    Nov 21 '20 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.