一鍵開啟 Soft Wraps
- 開啟 File → Settings(macOS: PhpStorm → Preferences)。
- 左側導航:Editor → General → Virtual Space。
- 勾選 Use soft wraps in editor。
- 點 Apply / OK 即時生效。
補充:針對特定檔案類型設定
- Editor → General → Soft Wraps。
- 在 Use soft wraps in these file types 加入檔案類型(如
*.md、*.txt、*.php)。
- 可同時勾選 Use original line's indentation for wrapped parts 保持縮排對齊。
效果對比
| 未啟用 | 啟用後 |
| 長行需水平捲動 | 自動在視窗寬度換行顯示,不改變實際檔案內容 |
結語
Soft Wraps 純屬編輯器視覺輔助,**不會在檔案寫入換行字元**。適合寬螢幕、Markdown、長字串編輯場景,保護頸椎、提升閱讀效率。