' Insert spaces for tabs ' does not work in Eclipse

Source: Internet
Author: User

Keywords:text Editor, Eclipse, indention, tabs, spaces, whitespaces, white spaces, convert

"I have enabled the" Insert Spaces for tabs "but there is still tabs fore tabs in editor that I am writing code. Why?"

Actually, there is other settings beside the setting for Text Editor. See below.

Java Editor
    1. Click Window » Preferences
    2. Expand Java » Code Style
    3. Click Formatter
    4. Click the Edit button
    5. Click The Indentation tab
    6. Under General Settings, set Tab policy to:Spaces only
    7. Click OK ad nauseum to apply the changes.
Default Text Editor

Before version 3.6:

Window->Preferences->Editors->Text Editors->Insert spaces for tabs

Version 3.6 and later:

    1. Click Window » Preferences
    2. Expand General» Editors
    3. Click Text Editors
    4. Check Insert spaces for tabs
    5. Click OK ad nauseum to apply the changes.

Note The default text editor is used as the basis for many Non-java editors in Eclipse. It's astonishing that this setting wasn ' t available until 3.3.

C + +
    1. Click Window » Preferences
    2. Expand /C + + » Code Style
    3. Click Formatter
    4. Click the new button to create a New profile and then OK to continue
    5. Click The Indentation tab
    6. Under General Settings, set Tab policy to:Spaces only
    7. Click OK ad nauseum to apply the changes.
Html
    1. Click Window » Preferences
    2. Expand Web » HTML Files
    3. Click Editor
    4. Under formatting, select the Indent using spaces radio button
    5. Click OK to apply the changes.
Css

Follow the same instructions for HTML, but select CSS files instead of HTML files.

Jsp

By default, JSP files follow the formatting preferences for HTML files.

Xml

XML files spacing is configured in Preferences.

    1. Click Window » Preferences
    2. Expand XML » XML Files
    3. Click Editor
    4. Select Indent using spaces
    5. You can specify the indentation size if needed:number for spaces to indent.

Reference:http://stackoverflow.com/questions/407929/how-do-i-change-eclipse-to-use-spaces-instead-of-tabs

' Insert spaces for tabs ' does not work in Eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.