Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio undo (Ctrl-Z) / redo (Ctrl-Y) not working

I've just moved from Eclipse to Android Studio and am finding really weird behaviour when I try to do Ctrl+Z / Ctrl+Y to undo/redo code changes.

It hard to describe what happens exactly, but the end result is that I usually end up just losing my code and having to type it back in from memory...

The 'undo' and 'redo' buttons in the IDE do seem to work fine, so maybe something is wrong with my shortcut keys (which would be surprising as I should just have a standard installation / setup).

Can anyone advise what to do, so Ctrl and Z / Ctrl+Y will work in the expected manner.

like image 771
ban-geoengineering Avatar asked Aug 31 '15 19:08

ban-geoengineering


People also ask

How do I undo undo Ctrl Z?

To undo an action, press Ctrl + Z. To redo an undone action, press Ctrl + Y. The Undo and Redo features let you remove or repeat single or multiple typing actions, but all actions must be undone or redone in the order you did or undid them – you can't skip actions.

How do I undo Ctrl Y?

To reverse your last Undo, press CTRL+Y. You can reverse more than one action that has been undone. You can use Redo command only after Undo command. To perform a function on all the content in the text editor, you need to select it all.

Is redo Ctrl Y or Ctrl Shift Z?

A shortcut key of a "redo" action is now Ctrl+Y in all Microsoft Office products. However, a lot of other programs like Matlab, Adobe Illustrator, and even old versions of Microsoft Office had "redo" action shortcut key as Ctrl+Shift+Z.

What is Ctrl y in IntelliJ?

Bookmark this question. Show activity on this post. The default IntelliJ / Android Studio "Redo" action shortcut is CTRL + Shift + Z and this is a common problem for Windows users. A bigger problem is CTRL + Y is mapped to the "Delete line" action - and this causes the undo stack to be lost.


2 Answers

With the help of this answer, I have worked it out...

  1. Go into Settings (Ctrl+Alt + S)
  2. Type Redo in the search box.
  3. Double-click on the Redo result
  4. Select Add Keyboard Shortcut
  5. Press Ctrl+Y
  6. Click OK
  7. Click OK
like image 72
ban-geoengineering Avatar answered Sep 22 '22 03:09

ban-geoengineering


To undo an action, do one of the following:

On the MainMenu, choose Edit | Undo. Press Ctrl+Z

To redo an action, do one of the following:

On the Main menu, choose Edit | Redo. Press Ctrl+Shift+Z

like image 21
Areeb Mahmood Avatar answered Sep 21 '22 03:09

Areeb Mahmood