Is there a short cut to select one line of code in android studio?
5 Answers
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.
- 2,908
- 4
- 22
- 34
You might also use CTRL + W several times.
- 5,252
- 1
- 42
- 41
-
Thank you! That's the one I've been looking for but didn't know how to put it in google – Asaf Apr 29 '18 at 14:20
-
1looking for that. using ctrl+w then ctrl + c improve my keyboard efficiency. – Shihab Uddin Jun 06 '18 at 05:26
-
1For OS X users, this is Option+Up – mennovogel Dec 06 '19 at 13:35
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)
- Go to Android Studio Preferences
- Go to
Keymap - Expand
Editor Actions - Scroll down to
Select Line at Caret - Assign any key command you want to it. I used
Command+L, but it is up to you.
- 32,650
- 19
- 86
- 115
Try using CTRL + C
This should select and copy the entire current line. Note that it won't work if you already have some text selected. In that case, CTRL + C would behave as usual, copying the text selected only.
I should note that I based my answer on that Android Studio is built off the IntelliJ platform, and so most shortcut keys are probably the same between the two.
Reference: Select current line in intellij
- 1
- 1
- 502,043
- 27
- 286
- 360
-
Have to wait for 2 minutes...@Divins answer is better.. I'll upvote you as this also solves the problem – suku Jan 09 '17 at 05:59
For Windows:
Shift+End(from cursor to line end)Shift+Home(from cursor to line start)- Triple click on a line
- 9,053
- 5
- 35
- 54
- 600
- 3
- 9