微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

vim:显示列表更改屏幕包装

我注意到,当我在文本中显示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 /$/

这将给你的EOLs带来绿色背景.有关如何指定突出显示的更多信息,请参阅:help highlight-args.

原始答案

这不是OP的实际问题,但有时可能会发生,所以我会留在这里让其他人在搜索时找到它们.

从“列表”的帮助:

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).

当然,请确保wrap,wrapmargin,linebreak和textwidth的设置是您想要的.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐