You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何在PhpStorm/WebStorm实现打开新标签时关闭未修改标签的功能?

How to Enable Auto-Close Unmodified Tabs in PhpStorm/WebStorm (Like Sublime/VSCode)

Got it, let's get this sorted! If you're missing that convenient behavior from Sublime or VSCode where unmodified tabs auto-close when you open a new file, PhpStorm and WebStorm absolutely support this—you just need to flip a few settings. Here's how:

  • First, open your IDE's Settings/Preferences:

    • On Mac: Use the shortcut Cmd+, or go to PhpStorm/WebStorm > Preferences from the menu bar
    • On Windows/Linux: Hit Ctrl+Alt+S or select File > Settings
  • Navigate to the Editor > General > Editor Tabs section in the settings menu.

  • Scroll down to the Close tabs automatically area, then check the box for Close tabs that were opened from the project view and haven't been modified.

That's it! Now, any tab you open from the project explorer that you don't make changes to will automatically close when you open a new file—exactly like the behavior you're used to. And just like in Sublime/VSCode, if you want to keep an unmodified tab around, simply hit Cmd+S (Mac) or Ctrl+S (Windows/Linux) to "save" it (even if there are no changes, this marks the tab as modified and prevents auto-closing).

If you want to tweak further, you can also adjust the Maximum number of tabs setting in the same section to limit how many tabs stay open at once, but the core auto-close for unmodified tabs is handled by that first checkbox.

内容的提问来源于stack exchange,提问作者Reacting

火山引擎 最新活动