zoukankan      html  css  js  c++  java
  • change Eclipse to use spaces instead of tabs?

    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 nauseam to apply the changes.

    [Note: If necessary save profile with a new name as the default profile cannot be overwritten.]

    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 nauseam to apply the changes.

    Note that 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 / C++

    1. Click Window » Preferences
    2. Expand C/C++ » Code Style
    3. Click Formatter
    4. Click the New button to create a new profile, then OK to continue
    5. Click the Indentation tab
    6. Under General Settings, set Tab policy to: Spaces only
    7. Click OK ad nauseam 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 of spaces to inde
  • 相关阅读:
    博客园开通新随笔
    遍历两个数组,并输出数组中的不同内容
    1021-二叉树复制和左右子树互换
    1020-层次遍历二叉树
    1019-计算二叉树的高度和结点数
    1018-深度遍历二叉树
    1017-乘积最大
    1016-求幂
    1015-最大公约数和最小公倍数
    1014-数据的插入与删除
  • 原文地址:https://www.cnblogs.com/kungfupanda/p/12861795.html
Copyright © 2011-2022 走看看