
我嘗試透過將 Eclipse IDE 的縮排寬度更改為 2 Preferences -> General -> Editors -> Text Editors -> Displayed Tab Width
。
但是,當我按tab或shift+時tab,我仍然縮排或取消縮排 4 個空格。為什麼?即使重新啟動 Eclipse 後仍然會出現這種情況。
答案1
如果您在程式碼格式化程式的首選項中搜索,我想您會找到您想要的東西。它應該位於:Java > Code Style > Formatter
應該有一個選項卡,標Indentation
有您要調整的設定。
另請參閱這裡Ctrl了解如何設定格式化程式以使用+ Shift+自動格式化程式碼F。