Shortcut to select a line of code in Android Studio

偶尔善良 提交于 2020-08-22 09:22:24

问题


Is there a short cut to select one line of code in android studio?


回答1:


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:


You might also use CTRL + W several times.




回答3:


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




回答4:


For Windows:

  1. Shift + End (from cursor to line end)
  2. Shift + Home (from cursor to line start)
  3. Triple click on a line



回答5:


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.


来源:https://stackoverflow.com/questions/41541694/shortcut-to-select-a-line-of-code-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!