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

6

53

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.

Perceptive answered 11/10, 2013 at 8:6 Comment(0)
N
91

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.

Nereen answered 11/10, 2013 at 14:39 Comment(6)
I have a "narrow" Apple keyboard so I don't have those keys.Perceptive
Can you use something like fn + left/right arrow to simulate home/end - therefore something like cmd + fn + left arrow for beginning of fileNereen
Boom! That's it. Can you update your answer so I can select it.Perceptive
To disable fn showing the desktop (MacOS Sierra) see this answer. superuser.com/questions/455603/…Boots
There so many shortcuts on android studio/intellij so I misshit something and something else happens and I don't know how to undo. But when I need a standard command, it doesn't have. Sure it is based on java, that is capable running on all platform, but not in the way it should.Dravidian
I ended up changing the key bindings. Using cmd+fn+left/right is already incomfortable, but adding shift to it (to select all the text) is just too much.Cuss
R
9

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

Reni answered 9/11, 2016 at 14:4 Comment(0)
D
6

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.

Disestablish answered 31/7, 2020 at 14:50 Comment(2)
absolutely brilliant!Brought
excellent. I am a very smart guy (I think) but I couldn't found this solutionDilatometer
S
1

For all the Linux users,

Navigate to start of the file: Ctrl + Home

Navigate to end of the file: Ctrl + End

Substandard answered 31/10, 2019 at 14:12 Comment(0)
C
1

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.

Cluff answered 12/2, 2022 at 20:13 Comment(0)
J
0

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

Joyless answered 12/6, 2023 at 7:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.