views:

78

answers:

2

I have some IronPython scripts that are embedded in a C# project, and it would be convenient to be able to edit them in the VS editor. VS evidently knows about Python because it provides syntax coloring for it. Unfortunately however the editor uses tab characters for indentation, whereas I want spaces. Is there a setting to change this? I don't see a heading for Python under Tools/Options/TextEditor.

A: 

Tools -> Options -> Text Editor -> Choose Language ( you might need to choose All Languages )

Click on Tabs and set it how you want it.

Edit: Looks like you can add your own file types in the same area and set Tab setting specifically for them.

No longer a user
+2  A: 

Here is one way to do it, probably not the best. On the Tools -> Text Editor -> File extension part of the Options menu add a .py extension, and set an type of editor. You don't get a python editor type, but you can pick one of the ones you use less often (for me this would be VB.net), and then make sure that the tab settings for that language fit your needs. Syntax highlighting didn't seem to be affected for me.

Egor