Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I quickly rename an open file in WebStorm?

Tags:

webstorm

The documentation for WebStorm says if you want to rename a file, do it in the Project Tool window. The problem is that finding a file in the Project Tool window is a hassle. If you start typing there to find the file, it won't be able to locate it unless it is in an expanded folder.

How can I easily rename a file in WebStorm?

like image 980
M.K. Safi Avatar asked Apr 07 '14 10:04

M.K. Safi


People also ask

How do you rename a file that's open?

Find the file you want to rename, select it and select Rename on the ribbon (or press F2 on your keyboard). Type the new name you want the file to have and press Enter.

Is there a fast way to rename files?

You can press and hold the Ctrl key and then click each file to rename. Or you can choose the first file, press and hold the Shift key, and then click the last file to select a group.

How do I rename a file with keys?

Using a Keyboard ShortcutSelect a file or folder with the arrow keys, or start typing the name. Once the file is selected, press F2 to highlight the name of the file. After you type in a new name, press the Enter key to save the new name.


3 Answers

There is no way to rename file right from the editor. Try Navigate/Select In.../Project view to open a file in Project Tool window and then use Refactor/rename in its right-click menu You can also enable the 'Autoscroll from source' Project tool window option to have the currently opened file auto-selected in the project tree

Also, Refactor/rename is available in file right-click menu in the Navigation Bar if it's enabled (View/Navigation bar)

like image 107
lena Avatar answered Oct 18 '22 22:10

lena


In addition to that, You can use the shourtcut.

Click on the file in the project window & Press the buttton Shift+F6.

like image 41
Arunkumar Avatar answered Oct 18 '22 23:10

Arunkumar


Right click on the file -> Refactor -> Rename or just use Shift+F6 as a shortcut and a dialog window will open up so you can change the name.

like image 5
plazmonii Avatar answered Oct 18 '22 21:10

plazmonii