'How do I navigate to the start or end of a file in Android Studio?

In TextMate, for example, I use command + uparrow for the start of the file and command + downarrow for the end of the file.

Android Studio doesn't do this. How do I do the same thing in Android Studio?

Thanks.



Solution 1:[1]

Navigate by braces, with a couple iterations you will get to start and end of file:

To navigate to start use:

command + option + [

and for end use:

command + option + ]

Once you are at the outer-most brace, you will not need multiple keystrokes.

This is especially useful for more than one closure in your java file.

Navigating to Braces

Solution 2:[2]

Another option (Mac): cmd-A then left arrow. This does a Select All, then moves the cursor to the start of the selection, i.e. the start of the file. I find that easy to remember.

Solution 3:[3]

For all the Linux users,

Navigate to start of the file: Ctrl + Home

Navigate to end of the file: Ctrl + End

Solution 4:[4]

For those that want to use the cmd + ?/? shortcuts and change the Keymap.

Go to Preferences (cmd + ,) > Keymap.

Search for Move Caret to Text Start and Move Caret to Text End and change the keyboard shortcut to (cmd + ?) and (cmd + ?) respectively.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 YCF_L
Solution 2 Ben
Solution 3
Solution 4 denfrancis