Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcut to select current line in Xcode

Tags:

xcode

Is there any way to select the text of the current line in Xcode? This would be equivalent to Cmd + l in Sublime or V in vim.

like image 655
goodcow Avatar asked Aug 15 '14 15:08

goodcow


People also ask

How do you select current line on keyboard?

To select a line of text, place your cursor at the start of the line, and press Shift + down arrow. To select a paragraph, place your cursor at the start of the paragraph, and press Ctrl + Shift + down arrow.

What is the shortcut to select a line on a Mac?

Shift–Command–Down Arrow: Select the text between the insertion point and the end of the document. Shift–Command–Left Arrow: Select the text between the insertion point and the beginning of the current line. Shift–Command–Right Arrow: Select the text between the insertion point and the end of the current line.

What is the shortcut key of Select the line?

Select an entire line of text by holding down the "Shift" key and pressing "End", if you are at the beginning of the line, or "Home" if you are at the end of the line. Select an entire paragraph by placing your cursor at either the beginning or the end of that paragraph.


2 Answers

Actually you can just use the normal Mac-Shortcuts.

Beginning of Line
cmd + shift + >

Middle of Line
1. cmd + > (this brings you to the end of the line)
2. cmd + shift + < (selects everything to the left)

End of Line
cmd + shift + <

Hope this helps :)


Update

In Xcode 8, I have found the Select Line keyboard binding which you can set to cmd+l (that's L, not i) for instance to make Xcode select the line you're on right now when hitting that shortcut.

key binding in xcode settings

like image 71
LinusGeffarth Avatar answered Sep 26 '22 23:09

LinusGeffarth


You can actually assign a key command to this. In Xcode under Preferences > Key Bindings > Text search for "Select Line" and assign it to you preferred key command (I also prefer command-l to match Sublime Text)

enter image description here

like image 37
jpschroeder Avatar answered Sep 27 '22 23:09

jpschroeder