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步,编辑该样式即可。
选中需要tab变为space的代码,format即可。

猜你喜欢

转载自blog.csdn.net/lucky_liuxiang/article/details/78228113