Xcode 9.x Line Duplication and Deletion

前端 未结 3 1530
北荒
北荒 2021-01-31 00:23

Up until Xcode 8.0, it was possible to customize IDETextKeyBindingSet.plist file. However, now it seems like modifying this file causes Xcode to stop behaving normally (e.g. arr

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 00:52

    Confirmed, still working in Xcode 11.2.1 on macOS Catalina 10.15.4

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

    2. Add the following lines into the root dictionary

        Sublime Commands
        
            Cut Current Line
            selectLine:, cut:
            Copy Current Line
            selectLine:, copy:
            Duplicate Current Line
            selectLine:, copy:, moveToBeginningOfLine:, paste:, moveToEndOfLine:
        
    
    1. restart Xcode
    2. go into the Key Bindings settings and assign any shortcut you want to the new three commands. Just search for their keys.

    It's a shame that in the 21st century you still have to manually add such basic shortcuts.

    Caveat

    The steps have to be repeated after every update of Xcode.

提交回复
热议问题