Is there a way to change name of a file in Android Studio projects? I come from Visual Studio and tried to select-change name of file. I already tried to F2 thats keyboard shortcut.
4 Answers
Select file in project explorer and press -> Shift + F6
Select file with right click + Refactor -> Rename
-
1You can change Keymap to eclipse in android studio. so you can use eclipse shortcut too.– ShvetMay 14, 2015 at 4:06
-
@AhmetArslan Hey, you are right. How strange. I wonder if it's an updated version or I didn't do it correctly last time. I'll remove the comment to avoid confusion.– DavidOct 12, 2015 at 10:42
Find the file in the Project window:
Right-click >> Refactor >> Rename File
-
3
-
-
1I believe
Rename
searches for more usages including comments/strings, variables, text, and occurrences in tests whileRename File
just searches for references and comments/strings– RyanJan 10, 2017 at 19:05
If you have configure keymap as per "eclipse's keymap" than it will work.For change keymap , press Alt + Ctrl + S and change keymap from default to Eclipse Copy
Then below keys will work in android-studio :
1. Select particular file
2. Press Alt + Shift + R
Now rename your file name.
-
Alt + Shift + R is shortcut for Eclipse, Android Studio is now based on IntelliJ with Shift - F6 for rename refactor May 14, 2015 at 3:09
-
If you have configure keymap as per "eclipse's keymap" than it will work.For change keymap , press Alt + Ctrl + S and change keymap from default to Eclipse Copy . May 15, 2015 at 4:52
Sometimes refactoring variables with refactor rename don't works in code. Then we can use Ctrl+Shift+R (on PCs) or Cmd+Shift+R (On Macs)