How can I open a directory-based IDEA project from Windows Explorer?
I assume that this topic is already covered, but I couldn't find anything about this in the forum, so...
How can I open a directory-based IDEA project from Windows Explorer? Sometimes I prefer to just "click a project to open it", as I could do with the .ipr file.
It seems that now I need to first open IDEA, then open the project... Is that so?
请先登录再写评论。
Hello Gorka,
Yes, this is correct. We could probably provide a shell extension to allow
opening a directory-based project directly, but so far it's not on our roadmap.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
This behavior is kind of annoying, because when I launch IntelliJ from an icon it opens the last project I was viewing, which is not the project I want to open, so I have to wait fo the lengthy loading of a project I don't even want, before I can open the directory-based project.
Could you do something like this via registry instead of creating a full blown shell extension:
http://superuser.com/questions/412312/can-i-right-click-a-folder-in-windows-7-and-choose-open-with-sublime-text
Or create a new filetype and have a simple cmd/batch script in your project folder with the extension to launch idea with the scripts folder/project name to open the current folder?
Based on above This would add an 'Open Folder as IDEA Project' right-click option to all folders (not just ones with IDEA projects) so YMMV:
Windows Registry Editor Version 5.00
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\intellijidea]
@="Open Folder as &IDEA Project"
"Icon"="\"C:\\Program Files\\JetBrains\\IntelliJ IDEA 12.0\\bin\\idea.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\intellijidea\command]
@="\"C:\\Program Files\\JetBrains\\IntelliJ IDEA 12.0\\bin\\idea.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\intellijidea]
@="Open Folder as &IDEA Project"
"Icon"="\"C:\\Program Files\\JetBrains\\IntelliJ IDEA 12.0\\bin\\idea.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\intellijidea\command]
@="\"C:\\Program Files\\JetBrains\\IntelliJ IDEA 12.0\\bin\\idea.exe\" \"%V\""
Or if you create say a <project name>.ipd file (or might be able to associate with .iml files?) in your project directory and associate that with opening the following batch script:
@ECHO OFF
REM opens parameters parent folder (filename ignored) in IntelliJ IDEA
SET prjpath=%~dp1
IF %prjpath:~-1%==\ SET prjpath=%prjpath:~0,-1%
%IDEA_HOME%\bin\idea.exe "%prjpath%"
i.e. openFolderInIDEA.cmd %1 or possibly: CMD /C openFolderInIDEA.cmd %1
You'd need one such dummy file/association per directory based project, which is why .iml isn't such a bad idea. Content of this file is irrelveant, only required that an associated open handler calls the batch script.
May need to alter paths to fix you Intellij location etc...
In IDE Settings/General you can disable to Reopen last project on startup.
Then you will get a "welcome" screen from which you can see a list of your latest projects and open them by clicking on them.
@... very nice suggestion. You saved me a lot of headaches, specially with projects that take a lot to initialize