Just got started with pycharm and was wondering how can I simply copy a file in pycharm for editing purposes? For instance, I have a file opened, want to edit the code but want to make sure that I do not accidentally "over-save" the original file.
In other environments, I can simply right click the file, and copy it to a new file. I do not see a 'copy to new file' option in pycharm, but instead I do have to manually open a new file (File>New>Python..), and then manually copy all the code from the original file and paste it in the empty new file.
Am I missing something or is that not possible in pycharm?
Press Ctrl+Shift+C to copy the absolute path to the current file. Choose Edit | Copy Path/Reference from the main menu.
To reopen the closed tab, right-click any tab, and from the context menu, select Reopen Closed Tab. To open a new tab at the end of the already opened one, select the Open new tabs at the end in the tab settings.
If plain Ctrl+C and Ctrl+V don't work your terminal may require that you also hold down the Shift key to do copy & paste.
If I understood well, you are looking for to a something similar duplicate functionality.
So to do this, you can simply go to the project structure (the panel to the left) and copy the file in this way:
After this, paste your file in the directory that you want in this way:
In this way you have the possibility to duplicate the choosen file with another name.
Select the file in the Project or Project Files pane and then hit File>Save as... The save-as dialog that pops up has an option (checked by default) to "open copy in editor". Not exactly what you asked for but it's the easiest way I could find.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With