当前位置: 首页 > news >正文

vscode 打开 setting.json

  1. 按下Ctrl + Shift + P(Windows/Linux)或Cmd + Shift + P(Mac)来打开命令面板。
  2. 输入open settings,然后选择 Open User Settings(JSON)。打开settings.json文件

------修改设置-----:

1、  html代码的行长度, 避免格式化时换行

"editor.wordWrap": "on",
"editor.wordWrapColumn": 2000, // 设置为你想要的最大行长度"html.format.wrapAttributes": "auto",  
"html.format.wrapLineLength": 2000, // 设置为你想要的最大行长度

Formatting

To improve the formatting of your HTML source code, you can use the Format Document command ⇧⌥F to format the entire file or Format Selection ⌘K ⌘F to just format the selected text.

The HTML formatter is based on js-beautify. The formatting options offered by that library are surfaced in the VS Code settings:

  • html.format.wrapLineLength: Maximum amount of characters per line.
  • html.format.unformatted: List of tags that shouldn't be reformatted.
  • html.format.contentUnformatted: List of tags, comma separated, where the content shouldn't be reformatted.
  • html.format.extraLiners: List of tags that should have an extra newline before them.
  • html.format.preserveNewLines: Whether existing line breaks before elements should be preserved.
  • html.format.maxPreserveNewLines: Maximum number of line breaks to be preserved in one chunk.
  • html.format.indentInnerHtml: Indent <head> and <body> sections.
  • html.format.wrapAttributes: Wrapping strategy for attributes:
    • 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
    • aligned-multiple: Wrap when line length is exceeded, align attributes vertically
    • preserve: Preserve wrapping of attributes
    • preserve-aligned: Preserve wrapping of attributes but align
  • html.format.wrapAttributesIndentSize: Alignment size when using force aligned and aligned multiple in html.format.wrapAttributes or null to use the default indent size.
  • html.format.templating: Honor django, erb, handlebars and php templating language tags.
  • html.format.unformattedContentDelimiter: Keep text content together between this string.

Tip: The formatter doesn't format the tags listed in the html.format.unformatted and html.format.contentUnformatted settings. Embedded JavaScript is formatted unless 'script' tags are excluded.

The Marketplace has several alternative formatters to choose from. If you want to use a different formatter, define "html.format.enable": false in your settings to turn off the built-in formatter.

想见  HTML Programming with Visual Studio Code

http://www.lryc.cn/news/502618.html

相关文章:

  • 关于网络安全攻防演化博弈的研究小议
  • 【FAQ】HarmonyOS SDK 闭源开放能力 —Push Kit(7)
  • 远程桌面防护的几种方式及优缺点分析
  • ASP.NET|日常开发中连接Sqlite数据库详解
  • python的自动化seleium安装配置(包含谷歌的chromedriver)
  • QT requested database does not belong to the calling thread.线程中查询数据报错
  • 服务器一般装什么系统?
  • Linux vi/vim 编辑器使用教程
  • JavaEE多线程案例之阻塞队列
  • 梳理你的思路(从OOP到架构设计)_基本OOP知识04
  • nginx反向代理(负载均衡)
  • Android系统应用主要模块
  • 【万字详解】三维重建(二)——NeRF、NeuS、MeshUDF、NeuralUDF、3DGS、GShell
  • 【RK3588 Linux 5.x 内核编程】-内核线程与Seqlock
  • 访问者模式的理解和实践
  • 在Scala中对Map函数的使用
  • PyTorch基本使用-张量的索引操作
  • OpenCV实验:图片加水印
  • sql server log文件
  • Elasticsearch 集群部署
  • 微信小程序5-图片实现点击动作和动态加载同类数据
  • 策略梯度定理公式的详细推导
  • 力扣-图论-10【算法学习day.60】
  • 《Python WEB安全 库全解析》
  • Linux yum-config-manager命令异常
  • ios 开发配置蓝牙
  • geoserver(1) 发布sql 图层 支持自定义参数
  • Linux:network:添加ip的时候自动添加一个本地路由
  • go 集成nacos注册中心、配置中心
  • ssd202d-badblock-坏块检测