news 2026/4/15 16:32:50

VSCode - 显示EOL字符的插件

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
VSCode - 显示EOL字符的插件

VSCode自身没有显示EOL字符的功能,可以通过扩展插件来实现。

在插件市场搜索到:Render Line Endings

点击安装,Publisher:Josip Medved,选择相信第一次从此publisher安装程序。

This extension renders end of line characters (CR, LF, CRLF) when whitespace rendering is on.

Installation

* Press CTRL P or COMMAND P

* Writeext install medo64.render-crlf

* PressEnter

Features

* Renders end of line characters: CR, LF, CRLF

Note: CR files are not supported by VS Code. See Upstream Issues

* Only renders visible portions of text, which makes it very fast even for huge documents

* The characters used to render EOL can be customized

* Respects the value ofeditor.renderWhitespace

* The option can be toggled withView > Appearance > Render Whitespaceor from the Command Palette

* An example with editor.renderWhitespace: selection:

* Can be configured to highlight non-standard EOL only:

* Can be configured to highlight trailing whitespace only:

* Configuration options can be set per language

* Uses colors from the current theme:

* "editorWhitespace.foreground": Rendered characters

* "errorForeground": Non-standard EOL and trailing whitespace, if configured

Settings

This extension contributes the following settings (compatible withcode-eolextension):

Setting

Default

Description

"code-eol.newlineCharacter"

"↓"

Character used to display LF, Linux and Mac's line ending.

"code-eol.returnCharacter"

"←"

Character used to display CR, old Macintosh' line ending.

Note: CR files are not supported by VS Code: see microsoft/vscode#35797.

"code-eol.crlfCharacter"

"↵"

Character used to display CRLF, Windows' line ending.

"code-eol.highlightNonDefault"

false

If set, non-standard line endings will be highlighted as errors.

The standard EOL is taken from files.eol.

"code-eol.highlightExtraWhitespace"

false

If set, trailing whitespace will be highlighted as errors.

"code-eol.decorateBeforeEol"

false

If set, rendered characters will come before the end of the line.

Note: If set, line endings will not be rendered on empty lines.

"code-eol.forceShowOnWordWrap"

false

If set, rendered characters will always be shown when word wrap is on, regardless of the other settings.

"code-eol.forceShowOnBoundary"

false

If set, rendered characters will always be shown when in boundary mode.

"code-eol.colors.default.foreground"

(theme)

If set, used instead of theme default for coloring EOL characters

"code-eol.colors.error.foreground"

(theme)

If set, used instead of theme default for highlighting different EOL characters and extra whitespace

>Configuration Examples

Here are examples of a few most common adjustments.

>>Render All Whitespace

It's perfectly fine to use View -> Appearance -> View whitespace and for that you don't need to edit any settings. However, if you want to permanently turn whitespace on, you can do so:

{

"editor.renderWhitespace": "all",

}

>>Custom colors

You can override theme defaults, if so desired.

{

"code-eol.colors.default.foreground": "#007000",

"code-eol.colors.error.foreground": "#700000",

}

>>Alternate EOL Characters

If you don't like default characters, you can select any unicode character you like. For example, if you want it to look similar to Atom, you can use something like this:

{

"code-eol.newlineCharacter": "¬",

"code-eol.returnCharacter" : "¤",

"code-eol.crlfCharacter" : "¤¬",

}

(default characters are ↓, ←, and ↵).

Highlight Non-standard EOL:

If you want to highlight files that have different ending than defined in files.eol, you can set code-eol.highlightNonDefault:

{

"code-eol.highlightNonDefault": true,

}

Highlight Trailing Whitespace Only:

If you want to highlight trailing whitespace (either spaces or tab), there's a setting for that:

{

"code-eol.highlightExtraWhitespace": true,

}

>Upstream Issues

Please upvote the following VS Code issues:

Mixed Line Endings Are Not Supported (microsoft/vscode#127)

VS Code normalizes line endings of mixed files upon load, and thus this extension will always show one kind of EOL character.

>>CR Line Ending Is Not Supported (microsoft/vscode#35797)

VS Code does not support the CR line ending. Therefore, while you can configure it, you will never see CR as a line ending.

>>Not Rendering Glyphs For Large Files (microsoft/vscode#27100)

For performance reasons VS Code doesn't synchronize files that are over 5MB in size. Therefore, no line-ending characters will be visible on large files.

To avoid this you can set:

"editor.largeFileOptimizations": false

// some other symbols you might want to use:

// ¤

// ↓

// ←

// ↙

// ⇣

// ⇠

// ⇓

// ⇐

// ▼

// ◀

// ␤

// ¶

// ↲

// ↩

// ↴

// ⬎

// ⇂

// see more at https://unicode-table.com/en/sets/arrows-symbols/

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/9 16:58:05

继电器控制电路设计:从零实现方案

从零搭建一个可靠的继电器控制电路:不只是“接上线就能用” 你有没有遇到过这样的情况? 写好了代码,MCU GPIO也配置正确了,可一通电——继电器不动作、单片机复位、甚至烧了个IO口……明明只是想控制个灯泡或插座,怎么…

作者头像 李华
网站建设 2026/4/15 18:09:26

gpt导出聊天记录

1.官方导出方式 目前官方只支持个人空间的聊天记录导出,而且导出的时间较长,需要等待官方导出之后,发到你的邮箱,而且下载链接有效期只有 24 小时,很容易就错过了,或者忘记了。 2.借用插件 下载”ChatGPT…

作者头像 李华
网站建设 2026/4/15 13:46:31

为一个杯子开14次会,却在汽车上用手机芯片,这叫高品质?蒙谁呢!

某车企为了强调自己的电车品质高,说为了一个作为汽车周边产品的杯子就开了14次会议,以此来说明它对品质的重视,然而人们却清楚它在汽车上用了手机芯片,重要、涉及安全的汽车芯片却用了存在安全隐患、不耐用的手机芯片,…

作者头像 李华
网站建设 2026/4/10 15:16:09

系统学习screen指令:常用快捷键与配置文件设置

一次连接,永久可用:深入掌握screen终端复用实战技巧你有没有遇到过这样的场景?深夜正在远程服务器上跑一个耗时数小时的数据分析脚本,突然家里的Wi-Fi抽风断了——再连上去时,进程早已被SIGHUP信号终结,一切…

作者头像 李华
网站建设 2026/4/12 22:48:18

【倒计时三天】2025第八届金猿大数据产业发展论坛——暨AI InfraData Agent趋势论坛丨颁奖典礼·上海

第八届金猿颁奖典礼“重要提示➩ 活动报名&现场签到有好礼,先到先得点此小程序链接可报名参会大数据产业创新服务媒体——聚焦数据 改变商业数智产业正站在变革的临界点上。过去十年,大数据从技术概念演进为基础设施,完成了产业奠基&…

作者头像 李华
网站建设 2026/4/10 11:58:03

VHDL课程设计大作业:串并转换电路实战教程

从零实现串并转换电路:VHDL实战教学全记录你有没有遇到过这样的情况?明明写好了代码,仿真波形却乱成一团;状态机卡在某个状态出不来,valid信号一闪而过根本抓不住;串行输入刚来一个脉冲,系统就开…

作者头像 李华