加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-15 22:55:44 所属栏目:安全 来源:网络整理
导读:我注意到,当我在文本中显示EOL列表查询时,会删除换行符 体育 this is my text of this message 变成集合列表..eol this is my text of this mess age(EOL CHAR) 我希望看到EOL角色而不会破坏窗口边框处的文字. 那可能吗? 解决方法 不幸的是,这听起来像是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的设置是您想要的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读