我没有用JSON编写代码,我正在尝试配置一些关于崇高文本3的终端设置。为什么我的代码不能工作?我怀疑这与冒号有关,因为它们看起来与自述页面上的颜色不同。提前感谢!
[
"default_config": {
"linux": null,
"osx": "PowerShell",
"windows": null
},
"preserve_keys" : [
"ctrl+k",
"ctrl+p",
"ctrl+z",
"ctrl+c",
"ctrl+v",
"ctrl+x"
],
"theme": "default"
]发布于 2021-07-08 19:11:30
应该将[ ]替换为{ },如下所示:
{
"default_config": {
"linux": null,
"osx": "PowerShell",
"windows": null
},
"preserve_keys" : [
"ctrl+k",
"ctrl+p",
"ctrl+z",
"ctrl+c",
"ctrl+v",
"ctrl+x"
],
"theme": "default"
}如果要使用key value存储数据,则必须使用{ }。如果要将数据作为数组存储在json中,则必须使用[ ]。这就是让你犯错误的原因。
这里有一个很好的教程,您可以使用:https://www.digitalocean.com/community/tutorials/an-introduction-to-json
一切都很简单
https://stackoverflow.com/questions/68307413
复制相似问题