94

How can one move to previous caret position(s) in android studio? It was possible in Eclipse.

1
  • 2
    for mac:: backward: cmd + [ and forward: cmd + ] Jul 27, 2019 at 11:27

14 Answers 14

124

Use Ctrl + Alt + Left and Ctrl + Alt + Right

For Mac, use Command + Option + Left and Command + Option + Right

If these don't work for you, it is possible that these keys are assigned for some of the functions of your OS/video drivers, you can either disable the shortcuts that are using these keys from operating system settings/video driver settings or change shortcuts from Android Studio itself by going to:

File > Settings > Keymap > Main menu > Navigate > Back/Forward

Move to previous caret position Android Studio

Mac users can find this dialog by going to Android Studio's: App Menu -> Preferences

0
51

It's Alt + Ctrl + Right/Left arrow and mouse buttons 4 and 5 (if your mouse has those). You can change these shortcuts under:

File > Settings > Keymap > Main menu > Navigate > Back/Forward.

5
  • 9
    On Ubuntu these shortcuts move around virtual workspaces, so they are captured by the window manager before they get to AS. You may be having similar problems on your platform. Jan 25, 2016 at 22:30
  • 3
    As @michael mention on Ubuntu this keys are captured by system. If you go to Setting > Keyboard > Shortcuts > Navigation and change these keys these keys will start to work.
    – Baris
    Jan 17, 2017 at 10:45
  • 5
    In Windows you may find those keys flip the display orientation, so you'll have to disable the shortcuts: Right-click on your desktop, select Graphics Options > Hot Keys > Disable
    – tronman
    Aug 9, 2017 at 16:35
  • Am I on same planet as you are? Alt + Ctrl + Right/Left arrow rotate the window in Windows for me! Aug 28, 2018 at 13:17
  • Yes, those shortcuts are interfering, so you have to either change it in IDEA or disable the annoying window rotation shortcut.
    – Darek Kay
    Sep 5, 2018 at 11:01
12
  • Another option : move to the last edit location: CTRL + SHIFT + BACKSPACE

  • Move to the last cursor position: CTRL + ALT + left Arrow

3
11

In Android Studio, go to View and check the ToolBar option. It will show the Back and Forward buttons.

cmd + [ and cmd + ] will move your caret to the previous and next positions.

Confirmed on Android Studio v2.3.3 / MacOS

Use Ctrl + Alt + Left and Ctrl + Alt + Right

For Mac, use Command + Option + Left and Command + Option + Right

If these don't work for you, it is possible that these keys are assigned for some of the functions of your OS/video drivers, you can either disable the shortcuts that are using these keys from operating system settings/video driver settings or change shortcuts from Android Studio itself by going to:

File > Settings > Keymap > Main menu > Navigate > Back/Forward

Mac users can find this dialog by going to Android Studio's: App Menu -> Preferences

For Windows/Linux : Ctrl + Alt + Left / Right

For Mac : Cmd + Alt + Left / Right

Another option : move to the last edit location: CTRL + SHIFT + BACKSPACE

Move to the last cursor position: CTRL + ALT + left Arrow

cmd + [ and cmd + ] will move your caret to the previous and next positions.

Confirmed on Android Studio v3.0.1 / MacOS High Sierra Version 10.13.3

Ubuntu 19-04 (Gnome)

navigate back = alt + shift + left

navigate forwards = alt + shift + right

Source

10

If you don't want to use keyboard shortcuts, goto view >> Toolbar and check it (if its unchecked) as shown below

enter image description here

Doing this will add two shortcuts below menu options to navigate forward and backward like shown below

enter image description here

2

For those coming from Eclipse, you can have Android Studio use Eclipse style keyboard mappings. Keep in mind host OS can still intercept keystrokes and prevent some keystrokes from working as desired in both Eclipse and Android Studio. If you want to give it a try, here is where to switch it:

enter image description here

enter image description here

2

In Android Studio, go to View and check the ToolBar option. It will show the Back and Forward buttons.

1

cmd + [ and cmd + ] will move your caret to the previous and next positions.

Confirmed on Android Studio v3.0.1 / MacOS High Sierra Version 10.13.3

1

In recent Android Studio versions, to enable back arrow on toolbar, go to:

View -> Appearance -> Toolbar

0

cmd + [ and cmd + ] will move your caret to the previous and next positions.

Confirmed on Android Studio v2.3.3 / MacOS

0

For Windows/Linux : Ctrl+Alt+Left / Right

For Mac : Cmd+Alt+Left / Right

0

Ubuntu 19-04 (Gnome)

navigate back = alt + shift + left

navigate forwards = alt + shift + right

0

In MacOS

Go to Preferences -> Keymap, Confirm that you have macOS selected in dropdown.

Now go back to editor, press cmd + [ or cmd + ] to navigate.

0

enter image description here

In Android Studio BumbleBee | 2021.1.1, Just Click

View -> Appearance -> Check Toolbar

And you will see a right and left array to navigate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.