Xcode Keyboard Shortcut for CamelCase!

Sometimes it can be a pain moving around code in Xcode especially with long method and property names. Then I discovered an Xcode keyboard shortcut that rocks – move back and forward through camel case sub-words!

Use Control and Control to skip through camel case. Hold down shift to highlight as you go:

camelright.gif

You may be wondering why this isn’t working on your machine – this does take a tweak to achieve, as the Xcode shortcut is usually usurped by an OS keyboard shortcut preference to move through full screen windows.

If you can handle removing full screen keyboard shortcuts to go left and right (you can just as easily swipe four keys on the trackpad) then open System Preferences > Keyboard > Shortcuts and deactivate the ‘Move left a space’ and ‘Move right a space’ shortcuts:

Screenshot 2016-09-30 17.18.51.png

Alernatively, if you’re not keen on losing those shortcuts, you can always change the shortcut in Xcode – just look for Move Subword Back and MoveSubword Forward in Xcode Key Bindings Preferences.

iOS development with Swift - book: https://manning.com/books/ios-development-with-swift video course: https://www.manning.com/livevideo/ios-development-with-swift-lv

Tagged with: ,
Posted in Swift
One comment on “Xcode Keyboard Shortcut for CamelCase!
  1. Ben Winters says:

    I just set up a new Mac and couldn’t figure out why this shortcut wasn’t working. Love that camelcase navigation.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: