UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Xcode typing technique question

Forums > macOS

@matt  

Hey all, I'm just wondering if when I get to the end of a line and Xcode has auto-completed the parentheses and/or brackets for me, is there an easier way to jump past the auto-completion to the next line or text entry besides using one of the three methods I currently use: 1) typing the auto-completion, 2) using the arrow keys, or 3) using the mouse? Tabbing is useful for text field entries, at least.

-matt

3      

Pressing Command + Right Arrow Key will move to the end of the line. But that won't necesarrily be the place right outside the closing brace.

I don't know of a way to do that. But I'm not really an expert on those things. I've been trying to learn more shortcuts as I go though, and you can at least see all of the ones that are available to you by going to Xcode>>Settings>>KeyBindings

You can also create your own key bindings there. But it can be hard to figure out exactly what they all mean without trying them out and experimenting with them.

One customization that I have found helpful is creating a shortcut for deleting the current line I am on. Xcode doesn't have a shortcut for that by default. I no longer have to hold backspace until the line is gone, or select the whole line with my mouse. I just set up a shortcut for Delete Line and set it to Command + D and it will delete the full line that my cursor is currently on.

Another shortcut that I have found helpful is Control + K deletes the rest of the line to the right of where my cursor currently is. That one is set up in Xcode by default I believe.

But I still do find myself using the arrow keys to move around quite a lot.

4      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.