Quick-edit a single file, project or non-project, without loading the entire project. Using PhpStorm as system editor for PHP, SCSS etc. file types.
(Yes, there are similar questions in the forum but they're very, very old.)
Is it possible to open a single file, without PhpStorm opening the entire project?
Whether you open a file from Explorer ("Open With...") or from the "Welcome to PhpStorm" dialog, PhpStorm starts to scan and load the entire project. If a file is not part of a project, PhpStorm scans the entire hard drive, starting from C:\
Is there a way to prevent this from happening? Is there a way to double-click a file in Windows Explorer and have PhpStorm open that file and that file only?
Thank you!
Please sign in to leave a comment.
Well, PhpStorm is still project-oriented IDE. If I right click a file > Open with > PhpStorm while IDE is closed, it works fine: it creates a blank project with a file needed opened.
If you already have the IDE running - it will open the file in a new tab among the other currently opened project files.
Yes,
For me is the same as Dmitry described, but it gets annoying having recent projects list full of these single-file project, annoying!
Is there a way to specify default project for opening these kinds of files?
In that case, I would just create a single project to open these random files so my recent project list isn't cluttered.
-------------------------------------------------------------------------------------------------------------------------------
Also when opening a file with PhpStorm open, then it opens the file on the most recent open project.
Which also gets more complicated when you have multiple project windows open since the file opens in the background and does not activate/focus the PhpStorm window (even with single PhpStorm instance open!).
This also makes me guess, which project window the file opened. Especially when you rearrange taskbar icons and the most recent project is not the last one on the taskbar...
The default project option would also take this out of the consideration.
For usability reasons that is why I mostly use Notepad++ to make random edits, which is a bummer since it does not have the bells and whistles PhpStorm does.
Kristian, it would be better to express this as a feature request at our tracker: http://youtrack.jetbrains.com/issues/WI#newissue=yes
Currently I can't see how to force IDE into the behavior you've described.
Yes. This would be a nice to have. Random edit for random files out of the Project based edits we have been doing till now.
This is now possible in IntelliJ 2020.1: https://blog.jetbrains.com/idea/2020/04/lightedit-mode/
As I see the idea is even more simple: please allow me to open a random file any where in my desktop as "Scratch file", almost always what I need is to get some file, re format, have it pretty printed on my screen, debug or check contents and thats it. Or even quickly write a random shell script to do some task.
Jantsch, for most of these actions, you would need a project, so it basically used to work like that before we implemented LightEdit.
What difference does it make whether it's a scratch file or not?
Doesn't make any damn difference if is a scratch file or not, just mentioned them because: scratch files are files that PHPStorm creates, open and handle and ARE NOT PART OF THE PROJECT.
And of course, if I'm using PHPStorm is because I'm editing some project in first place, I would never load the whole PHPStorm paraphernalia just to view or edit a single file, for that VIM, emacs and nano are good enough and way much faster, but why use them if PHPStorm is already running...
Just wanted a 'File > Open file (shortcut)' option in the menu or 'pstorm /tmp/myfile.php', and thats it.
Instead I'm doing:
$ pbcopy < file
cmd+shift+n (new scratch)
paste
doing whatever I need and closing
close
even a:
$ pstorm /path/to/file.xx
would do well.
I feel confused.
If you disable the LightEdit mode (Help | Find Action | Registry | light.edit.file.open.enabled), create the PhpStorm command-line launcher (either Tools | Create Command-line Launcher or via Toolbox or via Snapcraft, depending on how you installed the IDE), this command should work just fine. Does it not?