gpt4 book ai didi

vim - 关于 Vim 中文本格式的问题

转载 作者:行者123 更新时间:2023-12-01 04:11:04 25 4
gpt4 key购买 nike

我正在使用 Vim 编写不是代码的文本,只是自由书写。要做到这一点,我喜欢 formatoptions包括 w标志,有时是 a旗帜。

w 标志应该使它在一行以非空白字符结束时出现段落结束,而不是在第一个空白行(这是 Vim 的默认设置)。这是帮助文档中的片段:

w   Trailing white space indicates a paragraph continues in the next line.
A line that ends in a non-white character ends a paragraph.

a 标志使您在键入时自动重新格式化。例如,在下面的文本和 w 和 a 标记行重新格式化的文档中,因为我只输入到“段落中的最后一行”而不是下面。
This it the first line of the paragraph. <cr>
The text in it reformats properly as I type <cr>
up to the last line of the paragraph, which is <cr>
right after this line, that is, just below here: <cr>
This is the last line of paragraph.<cr>
This is the first line of second paragraph. <cr>
Even though there is no blank line between <cr>
it and first paragraph, any reformatting of <cr>
the first paragraph ends at the last line <cr>
of first paragraph.<cr>
<cr>
This the the first line after second paragraph<cr>

现在我的问题:
aw标记重新格式化在我输入第一段时正常工作,即第二段保持不变。但有时我想使用 vap 选择当前段落.在我看来,与 w标志设置这应该只选择第一段。但实际上发行 vap在第一段也选择第二段,一直到空行 <cr> ,貌似无视了 w格式选项标志。

这是预期的行为吗?我错过了什么吗?为什么 vap不只选择我所在的段落,它在第一行结束,没有尾随空格?

最佳答案

如果您阅读了 :h paragraph 中的帮助信息这没有提到 'fo' 设置。所以
看起来 fo 设置并没有真正改变,什么定义了一个段落。这可能是一个错误或不清楚的文档,所以你可能想在 vim-dev 邮件列表上讨论这个。

关于vim - 关于 Vim 中文本格式的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6298568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com