Move to beginning of text in Xcode

前端 未结 9 2039
说谎
说谎 2020-12-23 16:18

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 th

9条回答
  •  有刺的猬
    2020-12-23 16:55

    Tested on XCode 10:

    Step1: Open the file located in the next path by a text editor

     /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
    

    Add the next elements to the end of the file:

    Sublime Commands
    
        Cut Current Line
        selectLine:, cut:
        Copy Current Line
        selectLine:, copy:
        Duplicate Current Line
        selectLine:, copy:, moveToBeginningOfLine:, paste:, moveToEndOfLine:
        Delete Current Line
        selectLine:, deleteToEndOfLine:, moveToEndOfLine:
        Move To First Char In Line
        moveToBeginningOfLine:, moveSubWordForward:, moveSubWordBackward:
    
    

    The previous last key 'Move To First Char In Line' will do your request, but I mentioned also other keys.

    Now save the file.

    Step2: Close XCode and reopen it.

    Step3: Navigate to keybinding in xcode preferences then assign your shortcut.

    XCode -> Preferences -> Key Bindings Then search for 'Move To First Char In Line' and assign your shortcut.

提交回复
热议问题