Joshua Pinter
Joshua Pinter

Reputation: 47551

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.

Upvotes: 54

Views: 8639

Answers (7)

Tayan
Tayan

Reputation: 2336

For me it's

fn + command + arrow < / arrow >

Upvotes: 0

Shahnazi2002
Shahnazi2002

Reputation: 89

This works for me on Windows:

Navigate to start of file: Ctrl + Home

Navigate to end of file: Ctrl + End

Simply!


  • If your keyboard doesn't have the Home and End keys, you must do this:

    Navigate to start of file: Ctrl + Fn + Left

    Navigate to end of file: Ctrl + Fn + Right

  • You can also do the following using Numpad, when Num Lock is turned off:

    Navigate to start of file: Ctrl + 7

    Navigate to end of file: Ctrl + 1

Upvotes: 0

denfrancis
denfrancis

Reputation: 11

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.

Upvotes: 1

Ben
Ben

Reputation: 2091

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.

Upvotes: 6

iCantC
iCantC

Reputation: 3190

For all the Linux users,

Navigate to start of the file: Ctrl + Home

Navigate to end of the file: Ctrl + End

Upvotes: 1

John Masiello
John Masiello

Reputation: 149

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

Upvotes: 9

Matt Whetton
Matt Whetton

Reputation: 6786

Cant you just use cmd (or ctrl) + Home / End

On a Mac slim keyboard (without dedicated Home or End keys), Fn + Left/Right arrow is the equivalent.

So Cmd + Fn + Left/Right arrow should go to Start/End of file.

Upvotes: 94

Related Questions