首页 > 解决方案 > 如何在不插入更多星号的情况下使“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.

这是所需的输出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.

这是 my 的当前值formatoptions

formatoptions=tqn

我查看并尝试通过从选项中:help formatoptions删除来获得所需的行为,但似乎都不会影响.cqgq

一个建议的答案是删除q,但这会导致以下输出(也是不可取的)。

 * 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

标签: vim

解决方案


我认为你需要:

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

这允许使用*或使用列表-


推荐阅读