{"id":478,"date":"2019-12-03T23:06:42","date_gmt":"2019-12-03T10:06:42","guid":{"rendered":"http:\/\/wp.gaborhargitai.hu\/?p=478"},"modified":"2019-12-03T23:06:43","modified_gmt":"2019-12-03T10:06:43","slug":"xcode-duplicate-current-line-keyboard-shortcut","status":"publish","type":"post","link":"https:\/\/wp.gaborhargitai.hu\/xcode-duplicate-current-line-keyboard-shortcut\/","title":{"rendered":"Xcode Duplicate Current Line Keyboard Shortcut"},"content":{"rendered":"\n
This is something that should have been implemented ages ago – but for some reason, it’s still not present by default.<\/p>\n\n\n\n
1. Navigate to the following folder using Finder (CMD + Shift + G):<\/p>\n\n\n\n
\/Applications\/Xcode.app\/Contents\/Frameworks\/IDEKit.framework\/Versions\/A\/Resources\/<\/code><\/pre>\n\n\n\n2. Open the following file in a text editor:<\/p>\n\n\n\n
IDETextKeyBindingSet.plist<\/code><\/pre>\n\n\n\n3. Add these lines above the last two lines:<\/p>\n\n\n\n
<key>User<\/key>\n<dict>\n <key>Duplicate Current Lines Down<\/key>\n <string>selectParagraph:, delete:, yank:, moveToBeginningOfParagraph:, yank:, moveUp:, moveToEndOfParagraph:<\/string>\n <key>Delete Current Line<\/key>\n <string>deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:<\/string>\n<\/dict><\/code><\/pre>\n\n\n\nIt should look something like this:<\/p>\n\n\n\n