XCode 12.4 - How to duplicate a line using a shortcut

Viewed 1162

I am trying to figure out how to use a shortcut to duplicate a line of code in Xcode version 12.4 (Especially in the .swift files, the current duplicate "cmd + D" shortcut works only for UIBuilder).

I saw a lot of documentation on the internet but nothing referring to newest versions of Xcode. Has anybody tried to solve this problem? Thank you in advance.

1 Answers

It works for me: open IDETextKeyBindingSet.plist in /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/ Add new -> Dictionary -> Add new Item inside -> new Item set String selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward: Like this:enter image description here

Then assign a key in Xcode -> Preferences -> Key Bindings enter image description here

Related