gpt4 book ai didi

vim:显示列表字符会更改屏幕环绕

转载 作者:行者123 更新时间:2023-12-02 12:14:40 25 4
gpt4 key购买 nike

我注意到,当我在文本中显示 EOL 列表字符时,换行符会丢失

体育运动

 this is my text of this 
message

在设置列表..eol之后变为

 this is my text of this mess
age(EOL CHAR)

我希望看到 EOL 字符而不破坏窗口边框处的单词。这可能吗?

最佳答案

不幸的是,这听起来像是 Vim 的记录限制。来自 linebreak 的文档(导致每个单词换行而不是每个字符的选项):

This option is not used when the 'wrap' option is off or 'list' is on.

替代解决方案:突出显示行尾。简单的一次性方法就是搜索它们 (/$)。除此之外,您还可以使用突出显示:

:highlight endofline ctermbg=Green
:match endofline /$/

这将为您的 EOL 提供绿色背景。有关如何指定突出显示的更多信息,请参阅 :helphighlight-args

原始答案

这不是OP的实际问题,但有时可能会发生,所以我将其留在这里供其他人搜索时查找。

来自'list'的帮助:

Note that list mode will also affect formatting (set with 'textwidth' or 'wrapmargin') when 'cpoptions' includes 'L'. See 'listchars' for changing the way tabs are displayed.

来自'cpoptions'的帮助:

L    When the 'list' option is set, 'wrapmargin', 'textwidth', 'softtabstop' and Virtual Replace mode (see |gR|) count a as two characters, instead of the normal behavior of a .

'cpoptions' 与 vi 兼容性有关 - 您是否将 vim 作为 vi 启动?或者你是手动设置任何这些标志?检查 echo &cpoptions 的输出,确保以 vim 启动,如果它仍然设置(不知道为什么会这样),您可以取消设置该标志 (设置 cpoptions-=L)。

当然,请确保 wrapwrapmarginlinebreaktextwidth 的设置为你想要什么。

关于vim:显示列表字符会更改屏幕环绕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2470833/

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