eclipse里怎么把tab键换成空格

如题所述

1.点击 window->preference-,依次选择 General->Editors->Text Editors,选中右侧的 insert space for tabs;保存,第一步完成;
2.点击 window->preference-,依次选择 java(或C++)->code style ->formatter,点击右侧的editor,选则左侧 tab policy的值为spaces only,确定,应用保存即可;
注意若出现应用Apply按钮为灰色的情况,需要回到上一步,点击new按钮,根据当前的样式重新生成一个新的样式并保存,重复第2步,编辑该样式即可。
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-11-30
1、Window-->Preferences-->Java-->Code Style-->Formatter
2、然后右边选择 Edit...按钮,在General Settings页中 Tab policy 右边的下拉框,选择Space only!
3、然后下面的Indentation size 和 Tab size 都设置成需要的空格数即可,一般是4个空格。
相似回答