I've grown accustomed to pressing Cmd-D to delete the entire line of text that I'm editing in Eclipse.

I can't seem to find a way to add this command to other Mac programs. Can this be done?

I do know about Cmd-Backspace and Ctrl-K but I want to delete the entire line, regardless of the position of the cursor and including the CR/LF at the end.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Create or modify ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
    "$\U007F" = (selectParagraph:, delete:); // $\U007F = shift-delete
}

The changes will be applied after reopening apps or logging out and back in. Custom keybindings don't work in some cross platform applications (like Eclipse, Netbeans, Firefox and Photoshop), but they do in most native ones.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.