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/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/1146011.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大模型的“牛顿难题”:为什么AI读遍人类所有书籍,仍无法发现万有引力?

来源:今日头条当所有人都在追逐GPT-5的幻想时,一位前谷歌工程师出身的老板揭示了AI发展的真正天花板:大模型永远无法成为牛顿。本文深度剖析了语言局限性与概率系统本质这两大根本缺陷,并提出了下一代AI可能的突破方向——从神经符…

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

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

从零实现多层PCB生产流程:实验室级小批量制作方案

实验室里的“芯片工厂”:如何亲手做出一块四层PCB?你有没有过这样的经历?设计好了一块精密的四层板,满怀期待地发给厂家打样,结果等了五天,收货一看——线宽偏差、孔铜太薄、甚至内层错位。更糟的是&#x…

构建轻量级嵌入式OS:Yocto内核裁剪全面讲解

如何用 Yocto 打造极致轻量的嵌入式 Linux 系统?从内核裁剪讲起你有没有遇到过这样的场景:一块 64MB 的 Flash,跑不进一个“最小”Linux系统;设备冷启动要等七八秒,用户还没操作就已经失去耐心;明明只是个数…

联邦学习不再安全?港大TPAMI新作:深挖梯度反转攻击的内幕

来源:机器之心本文第一作者郭鹏鑫,香港大学博士生,研究方向是联邦学习、大模型微调等。本文共同第一作者王润熙,香港大学硕士生,研究方法是联邦学习、隐私保护等。本文通讯作者屈靓琼,香港大学助理教授&…

嵌入式工控机中USB协议的配置手把手教程

嵌入式工控机中USB协议配置实战指南:从原理到稳定通信的完整路径在工业自动化现场,你是否遇到过这样的场景?一台嵌入式工控机接上扫码枪却毫无反应;插入U盘后系统日志里只有一串“enumeration failed”;摄像头刚识别出…

零基础小白指南:Python打造简易上位机软件

从零开始,用Python写一个能和单片机对话的上位机 你有没有过这样的经历? 手里的STM32或Arduino正在跑传感器数据,串口助手里一堆跳动的数字看得眼花缭乱,却没法保存、不能画图、也不够“专业”。你想做个专属监控界面&#xff0c…

HBuilderX安装后无法打开?Windows系统排查教程

HBuilderX 安装后打不开?别急,这份 Windows 排错指南帮你 10 分钟搞定 你是不是也遇到过这种情况:兴冲冲地按照 hbuilderx安装教程 下载、解压、双击 HBuilderX.exe ,结果——没反应?图标闪一下就消失&#xff1f…

P14370 [JOISC 2018] 最差的记者 3 / Worst Reporter 3 Solution

P14370 [JOISC 2018] 最差的记者 3 / Worst Reporter 3 Solution 注意:我个人推荐 LibreOJ 题面,看这份的样例图片会好不止亿点点。 前言 在考场上只拿了 12 12 12 分(只想出了 Subtask 2)QwQ,大佬勿喷&#xff01…

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

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

Windows平台常见USB转串口芯片驱动对比分析

USB转串口芯片驱动选型实战:从工程痛点看Windows平台四大方案的生死博弈你有没有遇到过这样的场景?项目现场一切就绪,设备通电、线缆插好,结果上位机死活读不到串口数据。重启无效,换电脑还是不行——最后发现是USB转串…

Vitis平台FPGA加速项目实战案例详解

FPGA加速实战:用Vitis把图像处理性能拉满的全过程最近在做一个边缘计算项目,客户要求对1080p视频流做实时预处理——既要跑Sobel边缘检测,又要加FIR滤波,还得控制功耗。一开始我们用树莓派OpenCV硬扛,结果帧率卡在15fp…

Day 12:【99天精通Python】文件操作 - 让数据持久化保存

Day 12:【99天精通Python】文件操作 - 让数据持久化保存 前言 欢迎来到第12天! 在前面的11天里,我们写的所有程序,数据都保存在内存中。一旦程序运行结束或者电脑关机,那些辛苦计算出来的结果、用户输入的信息瞬间就消…

电路仿真circuits网页版在模拟信号调理中的实践解析

用网页电路仿真玩转模拟信号调理:从零搭建心电前置放大器你有没有过这样的经历?手头有个传感器项目,信号微弱得像耳语,噪声却吵得像工地施工。想做个放大滤波电路,可一上电就失真、振荡、输出贴电源轨……改一次PCB要等…

Altium Designer铺铜与过孔连接方式详解

Altium Designer铺铜与过孔连接实战指南:从原理到一次成功的PCB设计你有没有遇到过这样的情况?明明所有走线都连上了,DRC检查却报出一堆“Unconnected Pin”;回流焊后发现几个接地过孔虚焊;高速信号完整性测试时噪声异…

RISC-V中断上下文保存与恢复流程系统学习

深入RISC-V中断机制:从硬件触发到上下文恢复的完整路径你有没有遇到过这样的问题——系统突然“卡死”,调试器显示程序跳到了一个完全意想不到的地方?或者在写中断服务例程时,发现某个变量莫名其妙地被改写了?如果你正…

PCB布局前的电路行为预判:电路仿真详解

PCB布局前的电路行为预判:为什么高手都在用仿真“排雷”?你有没有经历过这样的场景?PCB板子刚焊好,上电测试却发现电源振荡、信号失真、噪声超标……改版?又要等一周!成本又涨几千!更糟的是&…

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

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

HBuilderX Windows环境配置:新手教程(零基础必看)

从零开始玩转 HBuilderX:Windows 下的前端开发第一站你是不是也曾在搜索“前端怎么入门”时,被一堆专业术语搞得晕头转向?Webpack、Babel、TypeScript、Node.js……光是名字就让人想放弃。其实,前端开发的第一步,完全可…

MOSFET工作原理项目应用:DC-DC变换器驱动设计示例

从米勒效应到高效驱动:MOSFET在同步Buck变换器中的实战设计揭秘你有没有遇到过这样的情况?明明选了低导通电阻的MOSFET,效率却上不去;开关频率提不上去,温升还特别高;更离谱的是,示波器一测&…