Eclipse multi-line indent uses tabs instead of spaces (pydev)

zzz picture zzz · Jan 25, 2012 · Viewed 11.6k times · Source

When I highlight a block of text in Eclipse, and press TAB, it inserts a tab at the head of each line. I want it to insert 4 spaces instead.

I need to do this on a files with a custom extension: *.shpaml

I have PyDev installed.

Answer

Fabio Zadrozny picture Fabio Zadrozny · Jan 27, 2012

I'm considering that *.shpaml is opened with the PyDev editor...

There are 2 preferences related to that:

In window > preferences > PyDev > Editor, you can choose 'replace tabs with spaces when typing?' and in that same page 'assume tab spacing when file contains tabs?'.

So, probably you have both checked and your *.shpaml has some tab in it, which makes PyDev work with tabs... if you uncheck the 'assume tab spacing when file contains tabs?', it should do what you want.