88

How to delete the current line and add a new line in Notepad++?

These two operations are very common but I can't find any key setting how to do them in Notepad++. Can any plugin do this job?

Melebius
  • 6,183
  • 4
  • 39
  • 52
linjuming
  • 2,117
  • 4
  • 23
  • 32

4 Answers4

162

Ctrl + L cuts the current line

and

Ctrl + Shift + L removes the current line.

You can see and change hotkeys in Settings > Shortcut Mapper... > Scintilla Commands. Look for SCI_LINEDELETE and SCI_LINECUT.

The version of my Notepad++ is 6.1.1.

Pikamander2
  • 7,332
  • 3
  • 48
  • 69
Gang YIN
  • 2,509
  • 2
  • 21
  • 25
  • I see `contextmenu.xml` in Notepad++ 7.9 when clicking settings-> 'set context menu', but there are no commands like delete or cut line. – Timo Oct 20 '20 at 06:38
  • @Timo, you mean how to add scintilla commands into context menu? didn't find a way to do that... – Gang YIN Oct 22 '20 at 01:42
  • 1
    The key combination for deleting a line didn't work for me at first. The cause was AMD Radeon software using the same combination of keys to toggle "Performance Logging", so you may need to rebind/deactivate this first if you encounter the same problem. – devrys Jul 28 '23 at 10:17
23

Ctrl + L will cut the line.

Ctrl + Shift + L will delete the line (i.e. not copying it to clipboard).

Credits to @BobStein-VisiBone and @RyanGoldstein above.

Please note this works in more applications than just Notepad++!

Morteza Asadi
  • 1,819
  • 2
  • 22
  • 39
Jim Aho
  • 9,932
  • 15
  • 56
  • 87
3

Question #1 Ctrl + L or Ctrl + Alt + L as already answered

Question #2 Enter, will add a new empty line and align the cursor to previous

Morteza Asadi
  • 1,819
  • 2
  • 22
  • 39
Victor Barrantes
  • 2,258
  • 2
  • 20
  • 13
0

if you want to delete line you can use find replace feature with extended option in it like

  1. Click Ctrl+F and then go to replace tab
  2. Check the extended option in it
  3. in find type anything
  4. in replace you can type '\n'(to insert blank line) '\t' (to delete blank line)