0

My test.txt for this example.

   unicode 3000  (whitespace in Chinese mark)
!  unicode ff01
^  unicode ff3e
~  unicode ff5e 

enter image description here

The command can match whitespace in Chinese mark(u3000).

hi! ChineseMark ctermbg=red guibg=red
match ChineseMark /\%u3000/

enter image description here

And can be matched with

match ChineseMark /\%uff01/

enter image description here

And can be matched with

match ChineseMark /\%uff3e/

And can be matched with

match ChineseMark /\%uff5e/

Now i want to match character whose unicode code point is u3000 and characters whose unicode code points are from uff01 till uff5e.

match ChineseMark /[\%u3000\%uff01-\$uff5e]/

The expression /[\%u3000\%uff01-\$uff5e]/ can't do the trick,How to express this kind of unicode code points set in match command?

3

The syntax for unicode characters inside [] is different, you just omit the %:

match ChineseMark /[\u3000\uff01-\uff5e]/

\%uxxxx is an atom while \uff01 is character in a collection. You cannot use atoms inside collections. See :help /[.

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.