Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save icanswiftabit/6a8222ebd29c1875c9f8a2fde1e67d3b to your computer and use it in GitHub Desktop.
Save icanswiftabit/6a8222ebd29c1875c9f8a2fde1e67d3b to your computer and use it in GitHub Desktop.
1. Go to `/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources`
2. Open `IDETextKeyBindingSet.plist` in text editor or `sudo open`
3a. Text editor variant:
At end add dict
<key>Custom</key>
<dict>
<key>Duplicate Current Line</key>
<string>selectParagraph:, copy:, moveToEndOfLine:, insertParagraphSeparator:, pasteAndPreserveFormatting:, deleteBackward:, moveToBeginningOfText:</string>
<key>Delete Current Line</key>
<string>deleteParagraph:</string>
</dict>
3b. Sudo Open variant:
Add new dict with name `Custom` or other and add keys with string
[Duplicate Current Line][selectParagraph:, copy:, moveToEndOfLine:, insertParagraphSeparator:, pasteAndPreserveFormatting:, deleteBackward:, moveToBeginningOfText:]
[Delete Current Line][deleteParagraph:]
4. Restart Xcode
5. In `Key Binding` set shortcuts for `Duplicate Current Line` and `Delete Current Line`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment