vim: how to make gq work for CKJ

43 views
Skip to first unread message

ping

unread,
Nov 2, 2012, 11:35:55 AM11/2/12
to Vim.use.G
folks:
I don't know what happened, but it looks like my gq don't work well on
Chinese.

I remember it works just fine before with:
set fo+=mB

but not now....

this is my current settings:

formatoptions=tcqnmB

does it really depends on the different encoding when the HanZi were
inputted?

thanks!


regards
ping

Ben Fritz

unread,
Nov 2, 2012, 11:43:42 AM11/2/12
to vim...@googlegroups.com
On Friday, November 2, 2012 10:36:02 AM UTC-5, ping wrote:
> folks:
>
> I don't know what happened, but it looks like my gq don't work well on
>
> Chinese.
>

Can you give some example text, tell what exact command you execute, what the result is, and what you expected?

ping

unread,
Nov 2, 2012, 12:26:46 PM11/2/12
to vim...@googlegroups.com, Ben Fritz
hi Ben:

here are the "sample" text.

加州政府搞的医疗保险计划,叫做Kaiser,每月的保险费比参加商业保险便宜些。
但是参加这种保险,看病只能去Kaiser旗下的医院。就 像国内最早实施的那种医
疗保险一样,只能去“定点医院”看病,要知道在美国稍有些本事的医生,都独立开
诊所的,所以医院里大多是资格比较嫩的 刚从实习医出来没几年的小医生,而且
医院还承担教学的任务,做个手术啥的通常会有一批实习医围观。

It's a one line. I tried gqq, or gqap, neither works...
I have tw set to 80.

the expected result:
加州政府搞的医疗保险计划,叫做Kaiser,每月的保险费比参加商业保险便宜些。
但是参加
这种保险,看病只能去Kaiser旗下的医院。就像国内最早实施的那种医疗保险一
样,只能去
“定点医院”看病,要知道在美国稍有些本事的医生,都独立开诊所的,所以医院里
大多是资
格比较嫩的刚从实习医出来没几年的小医生,而且医院还承担教学的任务,做个手
术啥的通
常会有一批实习医围观。

It looks I have issue on my ubuntu , but, interestingly, I tried in a
cygwin vim/win7 and don't see the issue, so I guess it must be related
to my configs, but wondering what did I miss here?

thanks!

Ben Fritz

unread,
Nov 2, 2012, 12:41:47 PM11/2/12
to vim...@googlegroups.com, Ben Fritz
On Friday, November 2, 2012 11:26:56 AM UTC-5, ping wrote:
>
> It's a one line. I tried gqq, or gqap, neither works...
>
> I have tw set to 80.
>

When you say, "neither works," do you mean "nothing changed," or something else?

ping

unread,
Nov 2, 2012, 12:53:26 PM11/2/12
to vim...@googlegroups.com, Ben Fritz
right, nothing changed after I typed these 2 commands...

thanks!

Alick Zhao

unread,
Nov 3, 2012, 2:03:47 AM11/3/12
to vim...@googlegroups.com, ping
On Fri, 02 Nov 2012 12:26:46 -0400, ping wrote:
> hi Ben:
>
> here are the "sample" text.
>
> 加州政府搞的医疗保险计划,叫做Kaiser,每月的保险费比参加商业保险便宜些。
> 但是参加这种保险,看病只能去Kaiser旗下的医院。就 像国内最早实施的那种医
> 疗保险一样,只能去“定点医院”看病,要知道在美国稍有些本事的医生,都独立开
> 诊所的,所以医院里大多是资格比较嫩的 刚从实习医出来没几年的小医生,而且
> 医院还承担教学的任务,做个手术啥的通常会有一批实习医围观。
>
> It's a one line. I tried gqq, or gqap, neither works...
> I have tw set to 80.
>
> the expected result:
> 加州政府搞的医疗保险计划,叫做Kaiser,每月的保险费比参加商业保险便宜些。
> 但是参加
> 这种保险,看病只能去Kaiser旗下的医院。就像国内最早实施的那种医疗保险一
> 样,只能去
> “定点医院”看病,要知道在美国稍有些本事的医生,都独立开诊所的,所以医院里
> 大多是资
> 格比较嫩的刚从实习医出来没几年的小医生,而且医院还承担教学的任务,做个手
> 术啥的通
> 常会有一批实习医围观。
>
> It looks I have issue on my ubuntu , but, interestingly, I tried in a
> cygwin vim/win7 and don't see the issue, so I guess it must be related
> to my configs, but wondering what did I miss here?
>

That's quite possible. Can you use `vim -u NONE -U NONE testfile` to
reproduce the issue on Ubuntu? If the issue disappear you need to debug
your personal settings(vimrc, various settings under ~/.vim, etc).
Otherwise Ubuntu's system vim configuration is to be blame IMO.

--
alick
Fedora 16 (Verne) user
https://fedoraproject.org/wiki/User:Alick

ping

unread,
Nov 3, 2012, 1:03:57 PM11/3/12
to Alick Zhao, vim...@googlegroups.com
you are right. with vim -u NONE, I can make it work after :
set tw=80
set fo+=mB

now I have to figure out which part of my vimrc is the culprit...

Reply all
Reply to author
Forward
0 new messages