Search code examples
pythoneclipsepydev

Per-project indent space in PyDev


For some projects we use 2-spaces indentation and for others 4-spaces. I know how to change the indentation size in PyDev settings, but I don't know how to set it on a per-project basis.

So my questions are:

  • Is it possible to set a per-project indent size in PyDev?
  • If it is, how can I do that?

Solution

  • You can go to the preferences (PyDev > Editor > Tabs), configure the tab-length to the value you want and use theSave to ...>Project settings ...` button to save that configuration to a project (see screenshot below).

    It should create a file under project/.settings/org.python.pydev.yaml with the proper contents (which you should commit to your vcs so that other users will have the setting correct too).

    Tab preferences for PyDev