4

In Notepad++, when I press SHIFT+END to select text from the current caret position till the end of the current visual line, the whole logical line till its end limited with CR/LF is selected.

An example. If the caret is in the very first position in a text document, I get this after pressing SHIFT+END:

Notepad++: SHIFT+END selects till the end of logical line

However what I need is this:

Notepad++: SHIFT+END should select till the end of visual line

It seems this is the standard behavior in all well-known document editors including the built-in Windows Notepad & Microsoft Word. How to achieve this in Notepad++? Is there a setting, or another keyboard command for this?

  • I'd be curious about what happens if you press End (instead of Shift End), what happens when you press Ctrl-End, and what happens when you use SC1 or SCiTE (both available from the SCiTE site), since Notepad++ is based on SCiTE. [link]scintilla.org/SciTEDownload.html – TOOGAM Jul 13 '15 at 11:55
  • @TOOGAM, End works as expected - moves the caret to the end of the visual line. IMHO, now all this is not important as we have a working solution suggested by boot13. – TecMan Jul 13 '15 at 12:42
3

You can produce the desired behaviour using the Notepad++ Shortcut Mapper. From the menu, select Settings > Shortcut Mapper..., click the Scintilla commands button, and scroll down to SCI_LINEENDWRAPEXTEND.

In my install of Notepad++, this command has no keyboard shortcut by default. Double-click the entry and select Shift and End on the Shortcut dialog. Click the Add button, then the OK button.

Now you need to get rid of the old shortcut: find the entry for SCI_LINEENDEXTEND and edit it. Change the shortcut to something you're unlikely to use, like Ctrl-Alt-Shift-End, then click OK.

Pressing Shift-End should now select the current line to the right side of the screen as desired. Pressing it again should extend the selection to the next line.

  • 2
    Excellent!! I just set SCI_LINEENDEXTEND to 'None' in my configuration as I do not see any need in this feature. – TecMan Jul 13 '15 at 12:42
  • Ah, I didn't notice that was an option. Cool! I'm thinking about making that my default setup for Notepad++. I noticed this behaviour before but didn't look into a workaround until I saw your question. – boot13 Jul 13 '15 at 15:33
  • 2
    I also set the mirror command to move the caret to the first character of the current line by the Home key. This is SCI_HOMEDISPLAY. For selection, the corresponding command is SCI_HOMEDISPLAYEXTEND. – TecMan Nov 25 '15 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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