停止在CSS属性的冒号后自动添加空格

huangapple go评论57阅读模式
英文:

STOP auto adding space after colon on css properties

问题

是的,我知道,根据某人的标准,这样更易读。

在我们的情况下,这样做并不合适,我们多年来都是这样编程的,我们不想改变它。

当我使用自动完成添加CSS属性时,它是如何在冒号后面加一个空格的?我怎样才能禁用这个功能?

例如,如果我输入“flo”,然后按回车键填充“float”属性,编辑器会变成“float: ;”,但我想要的是“float:;”。

我每次都必须手动删除空格,真的很麻烦。

谢谢。

搜索、配置等等... 什么都不起作用。

英文:

Yes, I know, according to someone's criteria this is more readable.

In our case it is NOT and we have programmed like this for years and we do not want to change it.

How can I disable that when I add a CSS property with auto-completion, it puts a space after the colon?

If I write, for example "flo", and I press enter to fill the "float" property, visual will put "float: ;" and I want it to write "float:;".

I have to remove space every single time and it's really struggling.

Thank you.

Search, configuration etc... NOTHING WORKS

答案1

得分: 1

您应该能够按照您的需求进行操作。您正在寻找emmet首选项。请参阅Emmet首选项:v1.16版本说明

据说支持css.valueSeparator,还可以查看GitHub问题:Emmet首选项支持

因此,您应该能够在设置中执行以下操作:

"emmet.preferences": {
    "css.valueSeparator": ":",
}

css.valueSeparator的默认值似乎是: ,请参阅Emmet首选项

但是,出于某种原因,对我来说它不起作用 - 似乎某个自动完成选项未遵守css.valueSeparator设置。所以您可能会有更好的运气 - 或需要在GitHub上报告此问题。

英文:

You should be able to do what you want. You are looking for an emmet preference. See Emmet Preferences: v1.16 Release Notes:

There is supposedly support for the css.valueSeparator, see also GH Issue: Emmet Preferences support.

So you should be able to do this in your settings:

"emmet.preferences": {
    "css.valueSeparator": ":",
}

The default for css.valueSeparator appears to be : , see Emmet Preferences.

BUT, it doesn't work for me for some reason - seems like some completion option is not respecting the css.valueSeparator setting. So you may have better luck - or need to file a github issue on this.

huangapple
  • 本文由 发表于 2023年2月14日 02:45:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定