textwidth doesn't work for Chinese

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

textwidth doesn't work for Chinese

phyrster
Hi vimmers,

I am using vim with mutt to compose email messages. In my muttrc file, I
have already put in:

|set textwidth=77

and it worked for English. However, when it comes to Chinese characters,
the line just running on and on and I have to manually break it.

What do I need to configure to make Chinese characters comply with this
setting? I am using vim 6.3.71

regards

bxuef

--
dhammapada says:
 
  Trying to break out of the Tempter's control, one's mind writhes to and
  fro, like a fish pulled from its watery home onto dry ground. 34
 
  It is good to restrain one's mind, uncontrollable, fast moving, and
  following its own desires as it is. A disciplined mind leads to
  happiness. 35
 
Reply | Threaded
Open this post in threaded view
|

Re: textwidth doesn't work for Chinese

A.J.Mechelynck
bxuefeng wrote:

> Hi vimmers,
>
> I am using vim with mutt to compose email messages. In my muttrc file, I
> have already put in:
>
> |set textwidth=77
>
> and it worked for English. However, when it comes to Chinese characters,
> the line just running on and on and I have to manually break it.
>
> What do I need to configure to make Chinese characters comply with this
> setting? I am using vim 6.3.71
>
> regards
>
> bxuef
>

        :set formatoptions+=m

"Also break at a multi-byte character above 255.  This is useful for
Asian text where every character is a word on its own."

Use with caution: IIUC, with that setting, _anything_ above 255 (e.g.,
in Unicode encodings, French oe-ligature, Esperanto c-circumflex, Polish
e-ogonek, or anything Greek, Cyrillic, Hebrew, Arabic, devanagari, Thai,
etc.) will also allow a line break.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: textwidth doesn't work for Chinese

phyrster
On 17:26 Thu 06 Oct 2005, A. J. Mechelynck wrote:
> bxuefeng wrote:
> > What do I need to configure to make Chinese characters comply with this
> > setting? I am using vim 6.3.71
>
> :set formatoptions+=m
>
Thank you very much for this tip.
> "Also break at a multi-byte character above 255.  This is useful for
> Asian text where every character is a word on its own."

What is the command for "multi-byte character above 255"? Could you specify
it?

> Use with caution: IIUC, with that setting, _anything_ above 255 (e.g.,
> in Unicode encodings, French oe-ligature, Esperanto c-circumflex, Polish
> e-ogonek, or anything Greek, Cyrillic, Hebrew, Arabic, devanagari, Thai,
> etc.) will also allow a line break.

I am using vim under linux with utf-8 locale, will this make English break
at 255 characters?


regards

bxuef

--
dhammapada says:
 
  Weeds are the blight of fields. Delusion is the blight of mankind.
  Consequently offerings to those free from delusion are of great fruit.
  358
 
Reply | Threaded
Open this post in threaded view
|

Re: textwidth doesn't work for Chinese

A.J.Mechelynck
[hidden email] wrote:

> On 17:26 Thu 06 Oct 2005, A. J. Mechelynck wrote:
>> bxuefeng wrote:
>>> What do I need to configure to make Chinese characters comply with this
>>> setting? I am using vim 6.3.71
>> :set formatoptions+=m
>>
> Thank you very much for this tip.
>> "Also break at a multi-byte character above 255.  This is useful for
>> Asian text where every character is a word on its own."
>
> What is the command for "multi-byte character above 255"? Could you specify
> it?

Multi-byte characters above 255 are any characters whose value is above
255 decimal (or FF hex or 377 octal). To know the value of a character
(in alpha, decimal, hex and octal), place the Normal-mode cursor on it
then hit ga

If your 'encoding' is set to UTF-8, characters _not_ above 255 are those
that also exist in Latin-1.

>
>> Use with caution: IIUC, with that setting, _anything_ above 255 (e.g.,
>> in Unicode encodings, French oe-ligature, Esperanto c-circumflex, Polish
>> e-ogonek, or anything Greek, Cyrillic, Hebrew, Arabic, devanagari, Thai,
>> etc.) will also allow a line break.
>
> I am using vim under linux with utf-8 locale, will this make English break
> at 255 characters?

No. Normal English text uses mostly 7-bit US-ASCII (characters in the
range 0-127); it also uses a few nonalphabetic characters like ? or ? in
the range 128-255, and, in foreign words only, accented letters, also in
the range 128-255 (e.g. the ? [c-cedilla] in gar?on or fa?ade, the ?
[e-acute] in caf? or r?sum?, etc.).

>
>
> regards
>
> bxuef
>

Best regards,
Tony.