Xcode duplicate/delete line

前端 未结 22 1730
不思量自难忘°
不思量自难忘° 2020-12-04 04:59

Coming from Eclipse and having been used to duplicate lines all the time, it\'s pretty strange finding out that Xcode has no such function. Or does it?

I know it\'s

22条回答
  •  长情又很酷
    2020-12-04 05:36

    OK, so I had this working for a while and then suddenly it broke. Now I have combined from different posts here and found a solution that works for XCode 6.3.1.

    1. Go to /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/ with Finder.

    2. find the folder named Resources. Right Click it, press Get Info, unlock the sharing & permissions setting (By pressing the lock) and set it to Read & Write for all.

    3. Enter the folder and find the file IDETextKeyBindingSet.plist. Right Click it, press Get Info, unlock the sharing & permissions setting (By pressing the lock) and set it to Read & Write for all.

    4. Open the file with XCode (Default)

    5. Find deletions, right click and add a new row. Name it for example Delete Line. In the value field, type: selectLine:, deleteBackward: . (This can also be done for duplicate line: selectLine:,copy:,moveToEndOfLine:,insertNewline:,paste:,deleteBackward:)

    1. Start XCode, go to preferences / keybindings and search for Delete Line. Set shortcut. Enjoy.

提交回复
热议问题