Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio | Navigate to file in the project explorer from the editor

I find myself with many files open in the editor (in separated tabs), and sometimes I want to find specific file in the project explorer.

Does there is any shortcut to reveal the file in the project window ?

EDIT to do the question more clear I add a picture: enter image description here

like image 506
AsfK Avatar asked Sep 06 '16 12:09

AsfK


2 Answers

There isn't a single key combo that can do this, as far as I know, but you can go with

On Windows

Alt + F1 followed by either 1 or enter

On Linux (using Gnome)

Alt + Shift + 1 followed by either 1 or enter

On Mac OS

Option + F1 followed by either 1 or enter

Android Studio is based on intelliJ, which has a function to open the current file or symbol in various views. The default key combo (in Windows) is ALT + F1.

This offers to open the current file or symbol in a bunch of different views, but the first option (with shortcut key 1) is the project view.

It's the same as choosing the Navigate > Select in... menu option, followed by option 1.

Note that you can customise the key mappings, or select other defaults instead of the default intelliJ configuration, so this might not be the case with your set up.

You can check the key mapping in settings > Key map and search for Select In... or, more simply, click the navigate menu and look at the Select In... option to see the shortcut key displayed in the drop down.

like image 160
0x00h Avatar answered Sep 27 '22 19:09

0x00h


You can go to Navigate -> Select In, which has default shortcut Option+F1 on macOS.

For Xcode, the shortcut is Cmd+Shift+J. If you want the same, follow these steps

  • Go to Android Studio -> Preferences -> Keymap
  • Search for Select In in Navigate
  • Right click and select Add Keyboard Shortcut
  • Press Cmd+Shift+J

enter image description here

like image 44
onmyway133 Avatar answered Sep 27 '22 20:09

onmyway133