Skip to content

Instantly share code, notes, and snippets.

@Kymer
Forked from emotality/duplicate_line_xcode.md
Last active April 17, 2018 06:57
Show Gist options
  • Save Kymer/e70c1ecd92cecf13982349dd183dcfde to your computer and use it in GitHub Desktop.
Save Kymer/e70c1ecd92cecf13982349dd183dcfde to your computer and use it in GitHub Desktop.
Xcode duplicate line binding.
1. Open plist: `open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist`
3. Add the text of 'xcode_duplicate_key.txt' to this file
4. Go to Xcode preferences -> Key Bindings -> Text tab -> Scroll till you see Duplication
5. Click on Duplicate Current Line, add a shortcut for it, eg. Cmnd+D (resolve any duplicate bindings)
6. Open Xcode
<key>Duplication</key>
<dict>
<key>Duplicate Current Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
<key>Duplicate Lines</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
<key>Delete Line</key>
<string>selectLine:, deleteBackward:</string>
</dict>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment