Tuesday, March 19, 2013

How to insert spaces instead of tab in Eclipse

It's always a good practice to insert 4 spaces instead of tab when code indentation.
Eclipse can automates this process. Thus when we press "Tab" key, it simply insert 4 spaces into code.

1. Start Eclipse
2. Windows > Preferences > General > Editors > Text Editors

change tab to spaces
3. Keep the number as 4.
4. check the box, "Insert spaces for tabs".
5. Click "OK"
6. Test > insert tab into source file, check whether it is 4 spaces.


No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...