Eclipse has a keyboard shortcut which deletes either the current line (if nothing is selected) or all lines which are part of the currently selected text: Ctrl+D.

Is there a way to make Ctrl+D do the same thing in Notepad++?

The best I could do is remap the shortcut to Scintilla's SCI_LINE_DELETE, but that only deletes one line at a time, even if the selection spans multiple lines.

link|improve this question

50% accept rate
feedback

4 Answers

up vote 4 down vote accepted

Ctrl+L will achieve the same effect.

I'm not sure if you can map Ctrl+D to do the same thing or not. I've not really messed with the keyboard mappings with Notepad++ since they are very similar to those of Visual Studio

link|improve this answer
1  
Brilliant! Now I just have to find what Ctrl+L is mapped to ... edit aha, it's mapped to SCI_LINECUT. That was literally the next Scintilla command below SCI_LINE_DELETE. – Matt Ball Mar 16 '11 at 17:17
Glad I could help you out! – Anthony Shaw Mar 17 '11 at 19:05
feedback

I had to map Ctrl+D to both SCI_LINEDELETE and SCI_LINECUT in order to make it behave like Eclipse. Hope this is helpful.

link|improve this answer
feedback

You can use CTRL+DELETE to delete the entire content of a line. Then all you do is use DELETE again to remove the line feed. If that is not enough for you, you can create a macro to do both actions.

As it seems to have stopped working in the latest version, I recommend you to use the Macro approach for the entire problem. Go to Macro, "Start Recording", then press "Home", "Shift"+"END", "DELETE", "DELETE", then go to Macro and stop your Macro. After that, go to Save Current Recorded Macro" and chose a name and shortcut, (e.g. CTRL+DEL). This reenables the shortcut for delete line.

link|improve this answer
Ctrl+Delete does not delete lines in Notepad++ for me (I have not remapped any keys other than Ctrl+D). – Matt Ball Mar 16 '11 at 14:47
Which version of Notepad++ are you using? It's working on Notepad++ 5.8.2 under Win7 – private_meta Mar 16 '11 at 14:47
5.8.7 (the latest version) on Win7 x64. Did you mean Ctrl+Backspace? (also doesn't work for me) – Matt Ball Mar 16 '11 at 14:50
Ah, I just tested it with 5.8.7, and it didn't work either, let me see – private_meta Mar 16 '11 at 14:50
I updated my Answer – private_meta Mar 16 '11 at 14:54
show 6 more comments
feedback

There is a shortcut in Notepad++ to delete a line: Ctrl+Shift+L ..but this will only delete a single line.

Even if several lines are selected, it will only delete the line where the cursor is resting and not the highlighted lines.

So, the simplest way to delete a series of selected lines, you have to Record a Macro with these key shortcut combinations:

Ctrl+J

followed by

Ctrl+Shift+L

This will first JOIN the selected lines and then DELETE the whole line.

This is better than using a combination of CUT and DELETE approach as mentioned above (which i've tried) because on some instances, it will also delete non-selected lines.

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.