.editorconfig

209 阅读1分钟

必须配合:EditorConfig for VS Code 插件使用

root = true #标明顶层配置

[*] #匹配所有文件

indent_style = space #缩进使用 Tab(tab)还是空格(space)

indent_size = 2 #使用空格缩进时的缩进大小

#tab_width = 2 #使用 Tab 缩进时的缩进大小,默认值为 indent_size

end_of_line = lf #配置行结束符(cr\lf\crlf)

charset = utf-8 #编码格式

trim_trailing_whitespace = true #是否移除行末的空白字符

insert_final_newline = true #文件是否以空行结束

[*.md]

trim_trailing_whitespace = false

  • * 匹配任意字符( / 除外)
  • ** 匹配任意字符
  • ? 匹配任意单个字符
  • [name] 匹配在 name 中的任意单个字符
  • [!name] 匹配不在 name中 的任意单个字符
  • {s1, s2, s3} 匹配给定的字符串中的任意一个
  • {num1..mum2} 匹配在范围 [num1, num2] 中的任意数字