VIM 中使用 `gq` 命令的中文额外 space 问题
The extra space problem for Chinese with `gq` command in VIM
下面是一段中文,忘记中文意思了。
以下是调用gq
命令后的中文段落。请注意,出现了一些额外的空格,例如 灵 活性
和 实际上 某种
。在中文中,我们不需要这样的额外空格。
以下是我的一些设置 .vimrc
set ts=4
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent
set smartindent
set ruler
set showcmd
set number
set nrformats=
set textwidth=80
set nocompatible
set formatoptions+=m
那么什么样的设置可以解决这个多余空格的问题呢?非常感谢。
来自:help fo-table
:
B: When joining lines, don't insert a space between two multi-byte characters. Overruled by the 'M' flag.
因此,
set formatoptions+=mB
下面是一段中文,忘记中文意思了。
以下是调用gq
命令后的中文段落。请注意,出现了一些额外的空格,例如 灵 活性
和 实际上 某种
。在中文中,我们不需要这样的额外空格。
以下是我的一些设置 .vimrc
set ts=4
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent
set smartindent
set ruler
set showcmd
set number
set nrformats=
set textwidth=80
set nocompatible
set formatoptions+=m
那么什么样的设置可以解决这个多余空格的问题呢?非常感谢。
来自:help fo-table
:
B: When joining lines, don't insert a space between two multi-byte characters. Overruled by the 'M' flag.
因此,
set formatoptions+=mB