Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut to delete the currently open file in PHPStorm?

When I navigate to a file deep in directories with Ctrl+Shift+N, I see that the file can be deleted, so I navigate to the project pane, and open all the nested directories and then finally delete the file, which is annoying.

Is there a keyboard shortcut to just delete the file currently open in the editor?

like image 292
Fluffy Avatar asked Jan 28 '15 10:01

Fluffy


People also ask

How do I delete a file in Phpstorm?

Select the item to be deleted. Do one of the following: Press Alt+Delete . Select Refactor | Safe Delete from the main or the context menu.

What is Ctrl Shift R in IntelliJ?

shift+F6. rename. ctrl+shift+r. ctrl+shift+N. find file / open resource.

What is Ctrl Alt L in IntelliJ?

Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.

What does Ctrl d do in IntelliJ?

I use Ctrl+D to add to selection (discrete multiple select) the next occurrence of the string (or substring) highlighted.


2 Answers

Yes, there is:

  1. Press Alt+Home to focus the navigation bar. (⌘+↑ on Mac)

    enter image description here

  2. Then press Delete. (⌘+⌫ on Mac)

    enter image description here

Even if the navigation bar is turned off, it'll pop up over the editor window.

like image 173
Ethan Avatar answered Sep 20 '22 12:09

Ethan


External tools can solve this.

  1. Create an external tool. The program to run is rm, and for the parameters use the $FilePath$ macro. I also tell it not to open the console.

Delete file - External Tool

  1. Add a shortcut in keymap to this external tool to quickly delete the current file open in the editor.
like image 22
Joe Mizzi Avatar answered Sep 18 '22 12:09

Joe Mizzi