I'm sorry, I don't find an already asked question for this problem...
in Xcode, what is the shortcut to edit multiples lines like the "CMD+click" of sublime text?
Select the lines you want and then press: Windows: Shift + Alt + i. Mac: shift + option + i.
If you want to add multiple cursors at the same column, instead of wasting time aiming and clicking, you can use the arrow key to navigate. Hold ⌃ – Control and ⇧ - SHIFT then ↑ or ↓ to add cursors to the line above and below your current position. You can deselect a cursor by hit the arrow in the opposite direction.
Hold down the Shift and Control keys, and double-click the second topAnchor in the second line to select it at the same time as the existing selection. So far, this is just like what we did before. Now: press the Left-Arrow key.
It is possible with Xcode 10+, see the wwdc2018 presentation of the functionality.
Ways to create multiple cursors:
- ⇧ Shift + ⌃ Control + Left Mouse Click: Will create a new cursor on every click
- ⇧ Shift + ⌃ Control + ↑: Will create a new cursor above
- ⇧ Shift + ⌃ Control + ↓: Will create a new cursor bellow
- ⌥ Option + drag: Will create a new cursor on every line you drag
preview:
For more information, see this answer
I'm not sure how helpful this is to you, but if you want to change a variable name, you can click it, hover over it until the triangle dropdown button appears, click it and select Edit All in Scope.
This allows you to change all instances of that variable name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With