How do I quickly rename a file name without refactoring in PHPStorm? Even after I've just created the file, PHPStorm takes a long time to search through my files for its usage.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Default is Shift-F6. For not refactoring, disable the checkboxes in the popup.
I wanted to use F2 for file renaming like Windows default.
You can make a shortcut for F2. Go to:
EDIT
If it does not work immediately, restart PHPStorm.
My technique for renaming files quickly is to single-click the file name and press Shift-F6. A dialog opens and you can immediately type the new name of the file and hit return/enter to complete the rename.
I find this technique intuitive because you don't have to move your mouse to the dialog window, type the new name, or click anything to confirm. As long as all you're doing is a rename that you know is safe, you just type it and go.
I also like this feature because you still have the option of quickly previewing the changes before they're made. And on those occasions when you are refactoring something with possible implications to the rest of your app, you can still enable "Search for references" and/or "Search in comments and strings" to get the whole enchilada. (I have those options disabled by default.)
I agree with you that right-clicking the file name, scrolling down to Refactor, selecting Rename, and then entering the new name is cumbersome, especially if the safe checks are enabled. I find that PhpStorm developers seem to understand these types of issues and usually have thought of a "faster way" to do things as well.
This will work for linux users.
It depends on
zenity
, so first check if it installed on your system,run in console:
zenity --version
If it output something like
3.18.1.1
- then it's ok.Create file
idea-rename.sh
with content below:Open your
Settings
>Tools
>External Tools
, click onand fill form as below
Name:
Rename
Group:
File
Program:
/bin/bash
Parameters:
/path/to/idea-rename.sh $FileDir$ $FileName$
Working Directory:
$ProjectFileDir$
Click
Ok
,Apply
After that you can see new item in your file menu
When you click on
rename
will opens dialogAfter rename in some cases phpstorm not sync files, so in path where located your file need to click in file menu "Synchronize 'path'"
You can't do it without refactoring, though
Refactor
|Rename
is usually very quick and you can disable options to search for references.