How to move to previous caret position in Android Studio

AndroidAndroid StudioKeyboard Shortcuts

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

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.

Solution 3 - Android

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

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

Solution 4 - Android

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

Solution 5 - Android

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

Solution 6 - Android

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

Solution 7 - Android

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

Solution 8 - Android

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

Solution 9 - Android

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

View -> Appearance -> Toolbar

Solution 10 - Android

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

Confirmed on Android Studio v2.3.3 / MacOS

Solution 11 - Android

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

For Mac : Cmd+Alt+Left / Right

Solution 12 - Android

Ubuntu 19-04 (Gnome)

navigate back = alt + shift + left

navigate forwards = alt + shift + right

Solution 13 - Android

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.

Solution 14 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAVEbrahimiView Question on Stackoverflow
Solution 1 - AndroidYogesh Umesh VaityView Answer on Stackoverflow
Solution 2 - AndroidDarek KayView Answer on Stackoverflow
Solution 3 - Androidhuu duyView Answer on Stackoverflow
Solution 4 - AndroidNavneet KrishnaView Answer on Stackoverflow
Solution 5 - Androidchampion-runnerView Answer on Stackoverflow
Solution 6 - AndroidJava42View Answer on Stackoverflow
Solution 7 - AndroidvirtualpathumView Answer on Stackoverflow
Solution 8 - AndroidDevendra AnuragView Answer on Stackoverflow
Solution 9 - AndroidskafleView Answer on Stackoverflow
Solution 10 - AndroidNick MillwardView Answer on Stackoverflow
Solution 11 - AndroidJGPhilipView Answer on Stackoverflow
Solution 12 - Androiddavid.barkhuizenView Answer on Stackoverflow
Solution 13 - AndroidRajeev JayaswalView Answer on Stackoverflow
Solution 14 - AndroidAminul Haque AomeView Answer on Stackoverflow