如何在PhpStorm中将行两侧的绿色背景设置为透明?
Hey there! I’ve dealt with this exact issue in PhpStorm before—those green side backgrounds can be pretty distracting. Let’s get rid of them by making them transparent, depending on what’s causing them in the first place:
Most of the time, that green edge highlight comes from one of two places: code coverage tracking (from running your tests) or version control change markers (like Git modified lines). Here’s how to tackle both scenarios:
1. If it’s Code Coverage Highlighting
That green usually pops up after you run your test suite, marking lines that were executed. To make it transparent:
- Open PhpStorm’s settings: Hit
Ctrl+Alt+S(Windows/Linux) orCmd+,(Mac). - Navigate to Editor > Color Scheme > Code Coverage.
- Look for entries like Covered Line or Covered Area (the label might vary a bit by PhpStorm version).
- Click the background color swatch next to the relevant entry.
- In the color picker, drag the opacity slider all the way to the left (0% opacity) or manually enter 0 in the opacity field.
- Hit Apply then OK to save the changes.
2. If it’s VCS Change Indicators
If the green is marking lines you’ve edited but haven’t committed to Git/SVN yet:
- Open settings again (
Ctrl+Alt+S/Cmd+,). - Go to Version Control > Highlighting.
- Find the Modified Lines entry (or similar, like Changed Lines).
- Click the background color swatch, set opacity to 0%, and save your changes.
Bonus: Check for Other Potential Causes
If neither of the above fixes it, it might be a plugin or another editor feature:
- Head to Editor > Color Scheme > General and check entries like Line Highlight or Selection—make sure their background opacity is set to 0 if they’re the culprit.
- If you use third-party code analysis plugins (like PHP Inspections), check their color scheme settings to see if they’re adding that green edge highlight.
Once you adjust the opacity, those annoying green side backgrounds should vanish completely, leaving your editor nice and clean!
内容的提问来源于stack exchange,提问作者darshit261991

