【问题标题】:VS Code Turn off wrapAttributes for auto formatterVS Code 关闭自动格式化程序的 wrapAttributes
【发布时间】:2020-09-02 15:10:12
【问题描述】:

我有以下 html 代码:

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"
    integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">

每当我通过按shift+Alt+f", it just wraps the integrityattribute to the next line. I would like to keep everything on one line. I did some research, and found out the setting that control it ishtml.format.wrapAttributes`来使用VS代码的自动格式化程序时,但根据文档,只有四个设置是:

auto: Wrap when the line length is exceeded
force: Wrap all attributes, except first
force-aligned: Wrap all attributes, except first, and align attributes
force-expand-multiline: Wrap all attributes

没有关闭它的设置。我尝试将其设置为"html.format.wrapAttributes": false"html.format.wrapAttributes": ""。他们没有帮助。

我想知道如何设置 VS 代码,以便每次我使用 VS 代码 HTML 自动格式化程序时,它不再将 integrity 属性包装到另一行?

【问题讨论】:

  • "html.format.wrapAttributes": "aligned-multiple" 有效吗?

标签: html visual-studio-code vscode-settings


【解决方案1】:

您应该可以选择preservepreserve-aligned

【讨论】:

    猜你喜欢
    • 2020-12-25
    • 2021-04-28
    • 2020-11-09
    • 2020-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-05
    • 2018-12-22
    相关资源
    最近更新 更多