xcode

Move to beginning of text in Xcode


I know I can bind keys to "Move to beginning of line", but this ignores the indentation.

What I'm looking for is to move to the beginning of text on a line, so that:

CGRect example = CGRectMake(view.frame.origin.x,
                            view.frame.origin.y,|

pressing a key will move the cursor to the beginning of the "view" word in this example (char | is cursor).

It is extremely annoying that currently I have to press 3 commands to get to the beginning of the text when inside a code block (cmd <-, opt ->, opt <-).


Solution

  • There's no standard way to accomplish it in XCode, so I've written an XCode plugin implementing this feature:

    https://github.com/insanehunter/XCode4_beginning_of_line

    Under the hood it overrides XCode's source editor keyboard action dispatch method and implements beginning/ending of line jumps in enhanced way.

    Hope it helped.