Reputation: 10929
Is there a short cut to select one line of code in android studio?
Upvotes: 19
Views: 17598
Reputation: 2537
In Android Studio Classic UI, you can select a line by clicking the line number on the left margin of the editor. You can select multiple lines by clicking and dragging over the numbers.
In New UI, clicking the line number creates a breakpoint by default. The same functionality as the Classic UI can be achieved by following this procedure:
Ctrl+Shift+A
Breakpoints Over Line Numbers
As described in https://www.jetbrains.com/help/idea/new-ui.html#gutter.
After applying this configuration, you can create a breakpoint by clicking in the empty area just to the right of the line numbers.
As suggested in the comments, triple click also selects the whole line.
Upvotes: 1
Reputation: 3176
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.
Upvotes: 31
Reputation: 33856
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)
Keymap
Editor Actions
Select Line at Caret
Command
+ L
, but it is up to you.Upvotes: 10
Reputation: 600
For Windows:
Shift
+ End
(from cursor to line end)Shift
+ Home
(from cursor to line start)Upvotes: 4
Reputation: 521457
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
Upvotes: 6