vim - 如何在不插入更多星号的情况下使“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
删除来获得所需的行为,但似乎都不会影响.c
q
gq
一个建议的答案是删除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
?
解决方案
我认为你需要:
set formatoptions+=n
set comments=fb:*,fb:-
set autoindent
这允许使用*
或使用列表-
。
推荐阅读
- winforms - 表单按钮显示在模拟器中但不显示在智能设备中
- perl - 如何读取持续更新的日志文件并匹配 perl 脚本中的特定模式
- excel - 我想合并一些txt文件
- git - 如何以不同的方式构建但使用相同的 package.json?
- c# - 如何使用 C# 在位图上绘制单色文本
- javascript - 使用 javascript 正则表达式删除多个反斜杠,同时保留 \n 特殊字符
- oracle - 如何知道我的会话中可以使用哪些模式?
- asp.net-mvc - 使用 Webmail 功能发送电子邮件时出错
- arrays - 如何在Ruby中的每个第n个字符之后有效地分割一个很长(数百万个字符)的字符串?
- time-series - Warpscript:操作计数超过最大值 100000