如何制作以*开头的gq换行而不插入更多星号?

时间:2019-02-01 18:44:29

标签: vim

考虑以下长行。

 * Explain that core policies were created to give applications the ability to control the mapping of (user) threads to cores, and why they might want to do this.

这是gq的当前输出。

 * Explain that core policies were created to give applications the ability to
 * control the mapping of (user) threads to cores, and why they might want to
 * do this.

这是gq

的期望输出
 * Explain that core policies were created to give applications the ability to
   control the mapping of (user) threads to cores, and why they might want to
   do this.

这是我的formatoptions的当前值:

formatoptions=tqn

我已经浏览了:help formatoptions,并试图通过从选项和c中删除q来获得所需的行为,但是似乎都没有影响{{1}的输出}。

是否可以通过某种格式选项设置来获得所需的输出?


更新:一个建议的答案是删除gq,但这会导致以下输出(也是不希望的)。

q

1 个答案:

答案 0 :(得分:1)

我认为您需要:

set formatoptions+=n
set comments=fb:*,fb:-
set autoindent

这允许使用*-进行列表。