43

Microsoft OneNote has a handy shortcut (Ctrl+A) that I use all the time to select an entire line.  And if you click it a second time it selects the entire document.

I really would like to use Ctrl+A as shortcut in Notepad++ to select the current line, but its default is to select the entire document.  Is there a way to make it select only the entire current line?

Macondo
  • 533

9 Answers9

43

Press Home then Shift+End.

End then Shift+Home can also be used. If you need to select the line from the very beginning instead of the first indented character, press Home twice.

You can also record this as a macro and then set a shortcut to that macro. However Ctrl+A is used as select all in almost all text editors and textboxes, thus changing it could make things more confusing. Use another shortcut instead

If you just want to copy/cut/delete the lines, there are already shortcuts for you:

  • Line delete Ctrl+Shift+L
  • Line cut Ctrl+L
  • Line copy Ctrl+Shift+T (changed to Ctrl+Shift+X in newer Notepad++)

There are also other actions without default shortcuts like line transpose, line join, line duplicate... Just select Settings > Shortcut mapper > Scintilla commands, select SCI_LINETRANSPOSE / SCI_LINEDUPLICATE / SCI_LINESJOIN... and assign them.

If Ctrl+Shift+T doesn't work for you then it's because the shortcut has been assigned to 2 different features, causing a conflict as PryrtCJ answered below. In newer Notepad++ line copy has been changed to Ctrl+Shift+X, and a shortcut conflict warning has also been added, making life a bit easier

enter image description here

See Lists of default mouse and keyboard shortcuts for Notepad++ and some plugins

If you're using a mouse, single click the line number on the left or triple click in the line also do the trick.

phuclv
  • 30,396
  • 15
  • 136
  • 260
10

In my system, Ctrl + i selects the current line.

Program version: x64 Portable 8.5.2. System: Windows 10.

Ian
  • 116
8

In NPP7.5.1 SCI_LINECOPY is assigned to Shift+Ctrl+X

So you can use Shift+Ctrl+X to copy current line to the clipboard

phuclv
  • 30,396
  • 15
  • 136
  • 260
Cheburek
  • 181
7

For those for whom the accepted answer doesn't work: I just answered a similar concern in the Notepad++ Community. Basically, there are two commands associated with Ctrl+Shift+T shortcut simultaneously, and the other appears to be taking preference.

If you would prefer Ctrl+Shift+T to reference SCI_LINECOPY, find the conflicting command (for example, Shortcut Mapper >> Main menu >> Restore Recent Closed File, which is what's causing the conflict in my copy of NPP), select Modify, then change the dropdown letter from T to NONE and hit OK. Assuming there are no more conflicts, the shortcut will revert to SCI_LINECOPY.

Hope this helps.

PeterCJ
  • 660
1

Just click 3 times to a word or line

0

Press Shift+Home if the cursor is at the end of the line. Press Shift+End, if the cursor is at the beginning of the line.

OR press Home key to get to the start of the line, and then press Shift+End.

OR press End key to get to the end of the line, and then press Shift+Home.

phuclv
  • 30,396
  • 15
  • 136
  • 260
0

If you have the Fn key, you can click (Fn + Arrow key), which selects from the cursor to the end or beginning of the line.

-1

Shift + End -- selects the entire line after the cursor.

MarianD
  • 2,726
-1

I think you can make it via Macro.

  1. Go to Macro > Start recording
  2. Hold Shift and tap Down to mark for example 10 lines . And delete them.
  3. Go to Macro > Stop Recording. Now your macro is recorded, you can save it for using in the future .
  4. Go to Macro > Save Current Recording Macro... . And save it with a name .
  5. Move cursor to line that you want to delete lines after that.Then go to Macro > Run A Macro Multiple Times... . And select your macro and run it N times that you want.

Reference: https://stackoverflow.com/questions/19161262/select-range-of-lines-in-notepad

CuongDC
  • 127