Shortcut to select a line of code in Android Studio

You might also use CTRL + W several times.


There is Command + C that will copy the entire line. But if you are like me and you don't want to pollute your clipboard history with line selections, you can try this solution. (Command + Shift + V to view clipboard history)

  1. Go to Android Studio Preferences
  2. Go to Keymap
  3. Expand Editor Actions
  4. Scroll down to Select Line at Caret
  5. Assign any key command you want to it. I used Command + L, but it is up to you.

Shift+Home or Shift+End will select all the text from the current caret position to the beginning or end of the current line. (Cmd+Shift+Left or Cmd+Shift+Right on mac). You can also triple-click on the required line to select it wholly. This can also be achieved by clicking on the line number.

If you want to copy/cut an entire line then Ctrl+C or Ctrl+X after placing the caret on the required line will do.

They have more useful shortcuts here.