news 2026/7/8 10:58:01

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/7/6 2:28:49

Multisim14.0到NI Ultiboard的无缝导出操作指南

从仿真到制板:手把手教你实现 Multisim14.0 到 NI Ultiboard 的高效协同设计 你有没有过这样的经历?在 Multisim 里把电路图画得清清楚楚,仿真波形也跑通了,信心满满地准备做 PCB 板——结果一导出,飞线乱成一团、封装…

作者头像 李华
网站建设 2026/7/1 11:44:22

导师严选 自考必用!10款一键生成论文工具深度测评

导师严选 自考必用!10款一键生成论文工具深度测评 2026年自考论文工具测评:为何需要这份深度榜单 随着自考人数逐年增长,论文写作成为众多考生面临的“拦路虎”。从选题构思到资料搜集,再到内容撰写与格式调整,每一步都…

作者头像 李华
网站建设 2026/7/1 16:30:47

UltraScale+ PCIe Gen4在Vivado2025中的实现方案

基于UltraScale的PCIe Gen4设计:Vivado 2025实战指南在当前高性能计算、AI推理加速和高速数据采集系统中,FPGA作为可编程异构计算核心,正越来越多地通过PCIe Gen4与主机CPU/GPU进行低延迟、高带宽互联。Xilinx(现AMD)的…

作者头像 李华
网站建设 2026/7/1 11:44:26

新手必看:TPS5430 buck电路入门教程

从零开始搞懂TPS5430 Buck电路:新手也能轻松上手的实战指南 你是不是也曾在设计电源时,面对一堆参数和拓扑图一头雾水? 想给STM32、FPGA或者传感器供电,却不知道该用LDO还是DC-DC? 看到“buck电路图”、“环路补偿”…

作者头像 李华
网站建设 2026/6/20 14:51:13

使用hbuilderx开发电商小程序多规格选择完整示例

用HBuilderX开发电商小程序,搞定多规格选择的完整实战你有没有遇到过这种情况:用户在商品详情页点来点去,好不容易选完颜色和尺码,结果一确认——“抱歉,该组合无货”?这种体验简直让人抓狂。而更糟的是&am…

作者头像 李华
网站建设 2026/7/3 10:25:03

Xilinx Ultrascale+平台下XDMA配置全面讲解

Xilinx Ultrascale平台下XDMA实战配置全解析:从IP定制到Linux零拷贝传输 为什么高速数据通路离不开XDMA? 在如今的AI推理加速、雷达信号处理和医学成像系统中,FPGA作为协处理器的角色愈发关键。但一个常被忽视的问题是: 再强大…

作者头像 李华