customize short-cut/hot-key/keybindings with an e.g. to delete line in XCode

first we have to get the terminology right, when we say short-cut, it is interchangeable with the terms "keybindings", or the "hot-keys". 


In Mac, you can actually define your own key bindings. the things to od is to create entries in the files under ~/Library/KeyBindings/PBKeyBinding.dict with the fllowing content and restart XCode. 

{
    "^$K" = (
        "selectLine:",
        "cut:"
    );

    "^$D" = (
        "selectLine:",
        "copy:",
        "moveToEndOfLine:",
        "insertNewline:",
        "paste:",
        "deleteBackward:"
    );
}
This will create two hot-keys, one Ctrl+Shift+K for deleting the current line and the Ctrl-Shift-D for duplicating the current line. 


or from another post, that you can set the delete line selected (or where the cursor is at )

{
    "^D" = (
        "moveToBeginningOfLine:",
        "deleteToEndOfLine:",
    );
}


References: 

XCode duplicate and delete line. 

XCode delete line hot-key 

你可能感兴趣的:(customize short-cut/hot-key/keybindings with an e.g. to delete line in XCode)