Is there a way (keyboard shortcut?) to open the folder of the currently opened file in Windows Explorer?开发者_开发技巧
What I mean is this: When a java source file is open in IntelliJ, I'd like to open Windows Explorer on the folder containing that file. Is there a short way of doing that?
Just padding out Peter Lawrey's answer, for Intellij 12.n on Windows 7 the steps for adding explorer as an external program would be:
- File > Settings > External Tools
- Click on the Plus (+) in the
- Name: Open Containing Folder
- Group: [select group]
- Description: Open Containing Folder
- Unselect "Open Console"
- Program: explorer [or] C:\Windows\System32\explorer.exe
- Parameters: $FileDir$
- Working Directory: [leave blank]
- Click OK
You can then add the External Tool as a keyed short cut through File > Settings > Keymap
Right clicking on a source file External Tools->Open Containing Folder is another way to use this tool.
As of version 2016.2 you can press Alt+F1 while in the editor and navigate to different view. Choose "Show in file manager". You can even navigate to a corresponding pom.xml from Maven view. Powerful, indeed.
You can try one of these plugins:
- "OpenContainingFolder"
- "Open containing folder in a File Explorer"
Just wanted to add to Simon B's answer that based on this article for selecting the file in addition to opening its parent folder in step 8 change "$FileDir$" to "/select, $FilePath$"
You can add explorer as an external program and add a hot key for that. i.e. you will be able to select a directory or file and the same opens in windows explorer.
This help page provides an easier way of doing this in later versions of IntelliJ as follows:-
- Hold down CTRL and then left-click the mouse on the tab containing the source code (i.e. the actual tab part at the top).
- This will display a folder hierarchy with the filename at the top: To open the folder the file is in, click on the the filename.
Use Open In
contextual menu option
Windows 10: use "C:\Windows\explorer.exe" instead. (#7 Program:)
You can assign a keyboard shortcut via setting/keymap. See the image below. Select a folder/sub-folder from the project directory tree and key in the shortcut.
精彩评论