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.
Select all, then do Ctrl + I . The advantage of this method over selecting some lines, then pressing Tab , is that it is much faster to do Ctrl + A then Ctrl + I , than tabbing lines at a time.
Although auto-indentation is not a feature of PyDev because of the language design you should be able to indent with a simple tab. Just select the lines you want to indent and press Tab. If you want to unindent lines you have to press Shift+Tab.
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.
You should be able to set "spaces instead of tabs" here:
Eclipse, Window, Preferences, General, Editors, Text Editors,
Insert spaces for tabs=Y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With