2015-05-05 131 views
15

我使用VS代码编辑多语言(主要是Ruby,PHP和Javascript)的项目,并且对于每种语言我们都有不同的缩进模型(空格/制表符和宽度)。看起来像VS Code支持这个功能,因为它允许editor.insertSpaceseditor.tabSize被设置为"auto",这是一种每种语言的定义。如何更改将“editor.insertSpaces”设置为“自动”的每种语言配置

虽然editor.tabSize看起来要做什么我想要的,editor.insertSpaces总是在"auto"模式下插入空格。

我试图找到哪里可以编辑每种语言的配置,但没有找到这样的设置。我还查看了resources/app/client/vs/languages下的语言目录,但未能找到指定这些功能的内容。

任何想法如何自定义每种语言的设置?

+0

我想'vscode '开始支持这个用例的插件,特别是'editorconfig'。 – sarbbottam

+0

请将此建议作为我们用户语音页面上的一项功能:http://visualstudio.uservoice.com/forums/293070-visual-studio-code –

+0

我已打开[uservoice ticket#7853865](http:// visualstudio。 uservoice.com/forums/293070-visual-studio-code/suggestions/7853865-allow-to-configure-the-auto-behavior-of-features) – Guss

回答

8

要使用perlanguage设置,您在方括号中使用[language_id]

例如:

{ 
    "[typescript]": { 
    "editor.formatOnSave": true, 
    "editor.formatOnPaste": true 
    }, 
    "[markdown]": { 
    "editor.formatOnSave": true, 
    "editor.wrappingColumn": 0, 
    "editor.renderWhitespace": "all", 
    "editor.acceptSuggestionOnEnter": false 
    } 
} 

更新:editor.tabSizeeditor.insertSpaces现在支持版本1.10

+1

感谢您提供关于未来支持的说明。这是我来这里的原因。 – Strake

+2

@Strake现在支持! – jbtule