今天设置Eclipse中按Tab键为4个空格,这里标记下!
?
Window-->Preferences-->Java-->Code Style-->Formatter
?
然后右边选择 Edit...按钮,在General Settings页中 Tab policy 右边的下拉框,选择Space only!
?
然后下面的Indentation size 和 Tab size 都设置成你要的空格数即可!一般是4个空格!!
?
注意:3.6之前版本好像设置Window-->Preferences-->General-->Editors-->Text Editors
?
右边的选项Insert spaces for tabs 勾上!然后 Displayed tab width =4也可以!但3.6不行!之前的我没试过...