设置Eclipse中的tab键为4个空格

  1. 在工具栏上找到window,点击 window->preference

    然后在打开的界面中选择 General->Editors->Text Editors,

    再选中右侧的 insert space for tabs

     

  2. 再点击 window->preference-

    依次选择 java(或C++)->code style ->formatter,

    选择右侧的editor,再选择左侧 tab policy的值为spaces only,确定

     

     

  3. 若出现Apply按钮为灰色的情况,需要回到上一步,点击new按钮,根据当前的样式重新生成新的样式并进行保存,重复第2步,编辑该样式即可

posted @ 2018-03-13 10:13  路途寻码人  阅读(237)  评论(0编辑  收藏  举报