Reputation: 7193
Eclipse version:
Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 2
Build id: 20140224-0627
This version of eclipse has been modified for an embedded system, but I am hoping the editor preferences are same among all versions of Eclipse
I want to be able to change tabs to spaces (that is, if I press the tab key, I want the editor to add in spaces, so that, for example, if I press backspace, only 1 space gets deleted at a time)
Currently when I press tab it actually inserts a TAB character (equal to about 4 characters) which causes a space equivalent to 4 characters to get deleted when I press the backspace
I went to Windows => Preferences and selected "Insert spaces for tabs" assuming it does what I want, but the editor still inserts a TAB (equal to 4 spacebars) instead of inserting 4 spacebars
How do I get it to insert spacebar characters when I press tab?
Upvotes: 1
Views: 3087
Reputation: 56
When you go to Window->Preferences->C/C++->Editor->Typing you may see a message that says "The tab display value (currently 4) and whether spaces are used to indent lines are configured on the code style preference page. The current indentation size is 4, using tabs."
Click on the "code style preference page" link, which takes you to Window->Preferences->C/C++->Code Style->Formatter, where different styles can be configured.
Upvotes: 4