vim - 如何防止以数字开头的行后缩进?

标签 vim restructuredtext word-wrap

我在 vim 中的 RestructedText 中遇到缩进问题。

当我编写 RestructedText (filetype=rst) 时,vim 在以数字开头的行后面放置一些空格:

vim puts some space after line starting with a digit like even in mid sentence
9 something things are working and doing something and I need a new line to
  prove my point

每次缩进当前段落 (gqip) 时都会收到此消息

有什么办法可以阻止“证明”前面的空格吗?

最佳答案

我无法重现这一点,但这看起来像是以下内容的组合

:set formatoptions+=n formatlistpat=^\\d\\+\\s\\+

我会通过更正'formatlistpat'来解决这个问题;它应该只识别格式类似于 1.1) 的数字(默认情况下如此),而不是简单的数字。

使用 :verbose set formatlistpat? 检查设置的位置,然后更改它,或覆盖 ~/.vim/after/ftplugin/rst 中的 RST 文件类型。 vim.

关于vim - 如何防止以数字开头的行后缩进?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39288082/

相关文章:

python - 是否有用于产量的 Sphinx reST Python 文档字符串字段?

vim - 如何编写vim函数将模板文本粘贴到当前文件中?

python - 如何使用 Sphinx 在 reStructuredText 中添加博客样式标签

python-sphinx - 脚注作为带有 reStructuredText 和 Sphinx 的上标链接

css - 为什么我的 td 不包装它的内容

text - 如何在 LaTeX 表格中换行文本?

regex - 如何替换一个句子

vim - 在vim中将2-space缩进更改为4-space

regex - 如何在 vim 正则表达式中扩展设置或变量?

css - 自动换行和打破我的网格的解决方案