17
votes

At my new job I have to work with PhpStorm. I come from Sublime Text, and what bothers me most about PhpStorm is the lack of a single click preview of the files. In stead, it opens the files for editing and adds them to active tab, leaving me with A LOT of useless tabs.

I searched here on StackOverflow and Google, but I seem to be the only one who is annoyed by this. In Sublime it goes to edit mode only after a double click. Is there a setting or plugin to have it like in Sublime?

6
I have a workaround for this. Go to Settings | Editor | General | Editor Tabs and set the Tab limit to 1 (Warning, all your tabs will get closed after 'Apply' or 'Ok'). In the Project-Window turn on the option "Scroll to Source". Single click on files will open them in only one editor tab. When you want to keep them, right click on a tab and Pin Tab ( I have a shortcut for "Pin active Tab" ). It's not perfect but it's something.Paul Geisler

6 Answers

10
votes

Single Click To Open File

By default to open a file in phpstorm you have to double click it. I found this to be very annoying. Luckily you can change this to be a single click.

Steps:

  1. Click the gear icon.

  2. Make sure 'Autoscroll to Source' is checked

  3. Make sure 'Autoscroll from Sourcce' is checked

http://www.ryanwright.me/cookbook/phpstorm/single-click-open-file

5
votes

There is no such functionality currently available. I may only suggest to use View | Quick Definition to preview files.

Other than that: https://youtrack.jetbrains.com/issue/IDEA-130918 -- watch this ticket (star/vote/comment) to get notified on progress.

3
votes

Welcome in late 2019 - we got a plugin for this now:

Plugin: https://plugins.jetbrains.com/plugin/12778-quick-file-preview

Plugin Source: https://github.com/SeeSharpSoft/intellij-file-preview

IntelliJ Issue: https://youtrack.jetbrains.com/issue/IDEA-130918

Don't forget to disable the "Autoscroll to Source" Feature, to get the full advantage of the plugin!

3
votes

It's a native feature these days:

Preferences / Editor / General / Editor Tabs / Opening Policy > check "Enable preview tab"

on version PhpStorm 2021.2

2
votes

The closest you'll get right now is to enable 'Scroll To Source', however this will actually open the file in another tab, it will not be a preview.

Open the Project, Favorites, etc. side bar (cmd + 1 or ctrl + 1)
Click the gear in the top right JetBrains Sidebar Settings Gear Icon
Select 'Scroll to Source'

Note
'Scroll to Source' can be enabled at the same as 'Scroll from Source', just make sure if you click on one file you wait until the sidebar catches up to click another, otherwise the sidebar will autoscroll back and forth between the two. You'll have to click one of them to break that loop.

Read more on JetBrains' website

0
votes

This is now available as a native feature in the latest version: 2020.3!

See this comment on the YouTrack link someone posted above https://youtrack.jetbrains.com/issue/IDEA-130918#focus=Comments-27-4500169.0-0

Also on the 2020.3 feature list under User Experience there's a mention of "preview tab" here https://blog.jetbrains.com/idea/2020/12/intellij-idea-2020-3/