2026/5/21 20:41:22
网站建设
项目流程
中国工程建设领域网站,电子商务网站设计与维护论文,嘉兴网站建设,物流网站建设 市场分析VSCode自身没有显示EOL字符的功能#xff0c;可以通过扩展插件来实现。
在插件市场搜索到#xff1a; Render Line Endings。
点击安装#xff0c;Publisher#xff1a;Josip Medved#xff0c;选择相信第一次从此publisher安装程序。 This extension renders end of li…VSCode自身没有显示EOL字符的功能可以通过扩展插件来实现。在插件市场搜索到Render Line Endings。点击安装PublisherJosip 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* PressEnterFeatures* Renders end of line characters: CR, LF, CRLFNote: 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 configuredSettingsThis extension contributes the following settings (compatible withcode-eolextension):SettingDefaultDescriptioncode-eol.newlineCharacter↓Character used to display LF, Linux and Macs 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.highlightNonDefaultfalseIf set, non-standard line endings will be highlighted as errors.The standard EOL is taken from files.eol.code-eol.highlightExtraWhitespacefalseIf set, trailing whitespace will be highlighted as errors.code-eol.decorateBeforeEolfalseIf 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.forceShowOnWordWrapfalseIf set, rendered characters will always be shown when word wrap is on, regardless of the other settings.code-eol.forceShowOnBoundaryfalseIf 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 characterscode-eol.colors.error.foreground(theme)If set, used instead of theme default for highlighting different EOL characters and extra whitespaceConfiguration ExamplesHere are examples of a few most common adjustments.Render All WhitespaceIts perfectly fine to use View - Appearance - View whitespace and for that you dont need to edit any settings. However, if you want to permanently turn whitespace on, you can do so:{editor.renderWhitespace: all,}Custom colorsYou can override theme defaults, if so desired.{code-eol.colors.default.foreground: #007000,code-eol.colors.error.foreground: #700000,}Alternate EOL CharactersIf you dont 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), theres a setting for that:{code-eol.highlightExtraWhitespace: true,}Upstream IssuesPlease 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 doesnt 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/