I can not seem to find a way to do this? I have a file named X in some folder, I want to create Y with the same contents in the same directory. The way I do in eclipse is to sel
As for a keyboard only solution to duplicate a file in IntelliJ:
On Linux:
Press Alt+Home to activate the navigation bar, then either press F5, or press Ctrl+C to copy the file and then press Ctrl+V to paste it, a dialog will appear to name your new file.
On Mac:
Press Cmd+Up to activate the navigation bar, then either press F5, or press Cmd+C to copy the file and then press Cmd+V to paste it, a dialog will appear to name your new file.
Ctrl + C on target file/folder
Ctrl + V on destination folder
Enter new name and press Enter...
I found that ctrl+c/ctrl+v will not copy files on IDEA in Linux (using x2go to connect on a Windows box). I was able to get it working if I close xclipboard but then copying between Windows and Linux dialogs stops working.
You will be prompted for a new name.
Works for classes too:
Pressing Function key+F5 will duplicate selected file, which will prompt you to enter a name.