On Sat, Jun 6, 2020 at 4:18 PM Matt <
matt...@gmail.com> wrote:
>
> Thanks for the detailed explanation, I would like to combine 6
> characters to create one multibyte code as you mentioned here:
>
> >But this is not all. Unicode also knows combining characters, which occupy no space by themselves but are printed on top of the previous codepoint, sometimes modifying its shape (think of accents, underlines, overlines, etc.). Each of these also gets its own codepoint, and there may be several on a single spacing character. The 'maxcombine' option, which can range from 0 to 6 (default 2) defines how many Vim will accept. Arabic can usually print even the most complex vocalised Coranic text with no more than 2 combining characters per spacing character, Hebrew may require 4 in some cases, so Vim took some safety margin and allows up to 6.
>
> I've `set maxcombine=6` but then what ? how do I combine 4 or 6
> characters into one (looking for a real example since Idon't know
> arabic or Hebrew). if someone can guide me through it I could submit
> an update in the help if that's of interest.
Neither do I know of a real case where a single spacing character
would realistically accept more than one; but the principle is simple:
with 'encoding' set to utf-8, you first type the spacing character;
then you type the (first or only) combining character (either directly
if you have it on your keyboard or in the currently enabled keymap, or
else by Ctrl-V u + hex value); then repeat zero or more times for any
additional combining characters.
See
:help mbyte-keymap
:help 'keymap'
:help i_CTRL-^
:help 'iminsert'
:help i_CTRL-V_digit
The following is an example of how to use combining characters to
write a Greek upsilon with both diaeresis and accent. I think the
equivalent exists for iota, but for upsilon I couldn't find it. Even
if it exists, or even if it wouldn't actually be used in Greek text,
the following is meant to illustrate the principle of how to use more
than one combining character on a single spacing character:
0. Make sure that Vim is in Insert (or Replace) mode.
1. Type a plain Greek upsilon, either with the help of a Greek
keyboard or keymap, or with |digraphs| as Ctrl-K u *
2. Add a combining diaeresis with Ctrl-V u 0308
3. Add a combining acute accent (AFAICT Unicode has no combining
vertical accent) with Ctrl-V u 0301
You'll notice that at steps 2 and 3, the cursor doesn't move, but the
contents of the screen cell immediately to the left of the cursor
change at the end of each step.
To find the hex code for any Unicode codepoint, there are the
following resources:
http://www.unicode.org/charts/ (by script and by family of symbols)
https://www.unicode.org/charts/charindex.html (alphabetical
index by name)
Best regards,
Tony.