When I transfer code (copy, paste) from Sublime Text to Visual Studio Code I get indentation errors while indentation looks fine. Even if I delete the indentation and retype it in Visual Studio Code I still get the indentation errors.


1 Answer 1


It's hard to answer your question without knowing the details (e.g. which third-party packages do you use, which default indentation settings). You didn't even mention how the indentation differs across editors.

However, I generally recommend using EditorConfig, which lets you define indentation rules (among others) for a project. About every major editor supports EditorConfig through plugins (including Sublime Text and Visual Studio Code). It's especially useful for teams that use a variety of different editors.

For Python, the Django .editorconfig file is a good starting point. Place it in the root of your project and now all editors with EditorConfig support will respect those rules.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .